Say there are millions of records in my table.
Here is my query to retrieve strings with a specific name from a list:
SELECT * FROM my_table WHERE Name IN ('name1','name2','name3','name4')
How to limit the returned result to name1, name2, etc.? The following query would limit the entire result (to 100).
SELECT * FROM my_table WHERE Name IN ('name1','name2','name3','name4') LIMIT 100
I need to limit to 100 for each name.
source
share