Selecting data with comparing two tables - MySql

Discussion in 'MySQL' started by themaster, Aug 30, 2008.

  1. #1
    Hi,
    I need help about selecting data on a special condition in MySQL.

    Here the details what I m trying to do;
    I have two table (table1 and table2). And I want to compare a column of each table. This columns are wordlist (at table1) and userword (at table2).

    What I want to do is comparing this two column in order to see which data at wordlist also in userword at table2. And selecting the data on userword (at table2) which is the same with at wordlist (at table1).

    Hope what i mean is clear.

    Any help pls..
    Thanks..
     
    themaster, Aug 30, 2008 IP
  2. CreativeClans

    CreativeClans Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    SELECT *
    FROM table1
    INNER JOIN table2
    ON table1.wordlist = table2.userword
    
    Code (markup):
     
    CreativeClans, Aug 30, 2008 IP
  3. themaster

    themaster Well-Known Member

    Messages:
    934
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    140
    #3
    Thanks :)
     
    themaster, Aug 30, 2008 IP