Skip to content
Advertisement

Select where in() for each id return equal rows count

How to select rows for each user_id equals select numbers of count for each user_id?

My example table:

My simple query:

select mp3_id where user_id IN (840,455) limit 8

Return:

But I want to this select:

I want each user_id to return an equal row count. How to?

Advertisement

Answer

or faster

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement