Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in SQL by (6.1k points)
I need to update multiple columns of a table in DB2 with a single update statement.

Any kind of help will be appreciated.

1 Answer

0 votes
by (12.7k points)

The update statement in all the versions of SQL will be like:

update table
    set col1 = expr1,
        col2 = expr2,
        . . .
        coln = exprn
    where some condition

Therefore, the answer is that you separate the assignments using commas and don't repeat the set statement.

Want to know more about SQL? Join this SQL Course by Intellipaat.

Related questions

0 votes
1 answer
asked Jul 16, 2019 in SQL by Tech4ever (20.3k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...