Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. SELECT name, number FROM table
  2. WHERE EXISTS (
  3. SELECT number FROM table
  4. WHERE number > 3
  5. )
  6. ORDER BY RAND()
  7. LIMIT 10
  8.  
  9. (select * from your_table where number > 5 order by rand() limit 1)
  10. union all
  11. (select * from your_table limit 9 order by rand())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement