I have a table in MySQL with a field "class_id". I need to write a query which returns top 15 rows sorted using descending time order, for each value in the list with IN clause.
Query for explanation:
select * from table_x where class_id IN (1,2,3) sort by time_x desc limit 15;
In the above example query, I need to fetch top 15 rows for each class_id (1,2 and 3) sorted based on descending time order.