How to select multiple random records where there should be one or two rows with a certain id?

0 like 0 dislike
8 views
How to select multiple random records where there should be one or two rows with a certain id ?
by | 8 views

1 Answer

0 like 0 dislike
Select * from table where id=14 order by rand() limit 88 - choose a maximum of 88 rows where aydishnik equal to 14. But it will work slowly and slow down the growth of volume of records. You can initially generate a random number and to use it as a down shift limit. Whether night or did not understand polnostiy - in the beginning talking about a few, then about one or two...
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
4 answers
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,865 users