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


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
10 views
How to select multiple random records where there should be one or two rows with a certain id ?
by | 10 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
35,430 users