Go4Expert

Go4Expert (http://www.go4expert.com/)
-   MySQL (http://www.go4expert.com/forums/mysql-forum/)
-   -   MySQL distinct random selection (http://www.go4expert.com/forums/mysql-distinct-random-selection-t29467/)

manaila 4Feb2013 12:14

MySQL distinct random selection
 
I have two tables tbl1 and tbl2.
I want to randomly select 10 rows from tbl1 which do not appear in tbl2.

NB:
I can do random selection from one table using:
Code:

SELECT * FROM tbl1
ORDER BY rand()
LIMIT 10;

Please assist on this.


All times are GMT +5.5. The time now is 14:51.