Below is my Table
Table1
+--------+----------+---------+ | amount | make | product | +--------+----------+---------+ | 100 | Nokia | Mo
SELECT a.* FROM Table1 a INNER JOIN Table1 b ON a.product = b.product AND a.amount <= b.amount GROUP BY a.amount, a.product HAVING COUNT(*) <= 2 ORDER BY a.amount desc
Please refer to http://sqlfiddle.com/#!2/9ba82/1