1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL distinct random selection

Discussion in 'MySQL' started by manaila, Feb 4, 2013.

  1. manaila

    manaila New Member

    Joined:
    Jul 6, 2010
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    On Earth
    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.
     

Share This Page