How to update value for multiple field in oracle sql?

Member

by rollin , in category: Third Party Scripts , 5 months ago

How to update value for multiple field in oracle sql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by lindsey.homenick , 5 months ago

@rollin 

To update values for multiple fields in Oracle SQL, you can use the following syntax:

1
2
3
UPDATE table_name
SET column1 = value1, column2 = value2, column3 = value3
WHERE condition;


In this syntax:

  • table_name is the name of the table you want to update.
  • column1, column2, column3, etc. are the names of the columns you want to update.
  • value1, value2, value3, etc. are the values you want to set for each column.
  • condition is an optional clause that specifies which rows should be updated.


For example, if you have a table called employees and you want to update the salary, department, and location columns for employees with an employee_id of 100, you can use the following SQL statement:

1
2
3
UPDATE employees
SET salary = 60000, department = 'Sales', location = 'New York'
WHERE employee_id = 100;


This will update the salary, department, and location columns for the employee with an employee_id of 100 in the employees table.

Related Threads:

How to update field by multiply field value in mongodb?
How to get the max value from count value in sql oracle?
How to update the time in oracle sql?
How to update multiple values in oracle?
How to pass value as parameter to join tables in oracle sql?
How to update only 3 column value in laravel?