Selecting distinct records using limit

I have a situation where I want to present 10 records at a time for a like lookup but if there is a duplicate name, I only want to show it once and count as 1 in the 10 to be presented. To complicate it, the search is dependent on location so I can’t consolidate the table prior to the selection.

So if I use the example of Burger King and I do a search in a large city, there will be numerous records in that city but I just want to show one when the like lookup is ‘Burg%’ so i would like to see Burger King, Burger Shack, etc. even though there are 35 records in the query for Burger King in that city.


Never mind, it seems to work fine with

SELECT name FROM t1 where city = 'boston' and name like 'Chi%'
GROUP BY name limit 0,10

yes, that’s a mysql enhancement to sql

this –

GROUP BY name LIMIT 0,10

is equivalent to this –

GROUP BY name 
ORDER BY name LIMIT 0,10

Interesting, I had actually gone back and added the ORDER BY so I will now remove that. I really appreciate the input.