Hi,
Is there a way to write a MySQL query so that I can make sure that not more than 10 records of the same value are returned.
I mean suppose I write the following query for some table:
is there some way I can modify the above query to make sure that everytime out of the 100 random rows returned, there are only 10 (or less) rows which contain the same surname
I mean anyway to at least make sure that there are not more than 10 anderson's in the above 100 rows returned? If anyone knows of any way of doing it, then please share it with me. I would really appreciate any help
Thanks in advance,
san.
---
cheers!
san
print length "answer to life the universe and everything";
Is there a way to write a MySQL query so that I can make sure that not more than 10 records of the same value are returned.
I mean suppose I write the following query for some table:
Code:
select first_name, last_name from table ORDER BY RAND() LIMIT 100
is there some way I can modify the above query to make sure that everytime out of the 100 random rows returned, there are only 10 (or less) rows which contain the same surname
I mean anyway to at least make sure that there are not more than 10 anderson's in the above 100 rows returned? If anyone knows of any way of doing it, then please share it with me. I would really appreciate any help
Thanks in advance,
san.
---
cheers!
san
print length "answer to life the universe and everything";