Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Update query with inner join

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 228
    Comment on it

    Hello readers, today we will discuss about the "SQL query with INNER JOIN".

    UPDATE 
    (SELECT table1.value as OLD, table2.CODE as NEW
     FROM table1
     INNER JOIN table2
     ON table1.value = table2.DESC
     WHERE table1.UPDATETYPE='blah'
    ) t
    SET t.OLD = t.NEW
    

    The above query will update the data in table1 and table2.

    here we are updating the table1 data like :- WHERE table1.UPDATETYPE='blah'

    I hope it helps you.

    Thank-you readers.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: