1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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