MySQL DB Question

Discussion in 'MySQL' started by amelen, Jan 5, 2010.

  1. #1
    Quick mysql db question for the experts out there.

    I have two mysql tabes:

    Table1
    ID
    username

    Table2
    ID
    username
    email

    How can I find all the records that have a certain "email" address in table 2 and then delete those records from both table 1 and table 2?
     
    amelen, Jan 5, 2010 IP
  2. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #2
    delete from table1,table2 where email.table2 = 'emailaddress' & username.table1=username.table2
    something like that
     
    crivion, Jan 6, 2010 IP
  3. amelen

    amelen Active Member

    Messages:
    686
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    85
    #3
    Thanks!!!!!
     
    amelen, Jan 6, 2010 IP