Updating more than one column
But, the syntax example above might not show the whole truth, since we can have a situation like this: In the expanded version of our UPDATE syntax above, the value that we want to update column1 with, actually comes from a different table.BUT, in this post I really wanted to show you how to update multiple columns in a table at once.But, you might have to have your DBA activate the schemas, and give you access.Let us start simple, and pretend that the department with id # 20, “Marketing” is from now on going to be named “Customer Relations”.So, with the syntax shown earlier in mind, let us put things together, and look at some practical examples.BTW – If you are interested in where I get the data for these examples – they are from the sample schemas (OE, HR, etc.) that comes with most Oracle database installations.
I work a lot with Data Warehouse data, where we many times have duplicate data for speed purposes, etc.
And, some times, rater than using a ginormous INSERT or UPDATE statement, I actually build the records first with mostly empty columns, and then fill in a few columns at the time.