I have a below SQL query to get the three records for notifying purpose.
SELECT orders.msg FROM orders INNER JOIN ( SELECT id FROM orders WHERE type_id = 12 O