| postid | value | title | ---------------------------- | 1 | 0 | Title 1 | | 2 | 1 | Title 2 | | 3 | 1 | Title 3 | | 4 | 0 | Title 4 | | 5 | 4 | Title 5 |
I am trying to select two randomly distinct rows from my table. Is there a way to do it with SQL?
I’ve tried
SELECT postid
FROM table
WHERE postid > 0.9
ORDER BY RAND( )
LIMIT 2
Try this