SQL Query help - 10 records for each distinct column value
I have a cars table which contains car listings. The table structure looks something like: cars - id - title - make - year I would like a query which returns 10 cars of each make. Something equivalent to the following pseudo code: car_makes = select distinct make from cars for each make in car_makes select id, title, make from clcars where make = $make limit 10; end Here's what I've tried unsuccessfully: select id,title,make from cars where make in (select distinct make from cars) group by make; --- This returns only one record per make. select a.id,a.title,a.make from cars a left join (select