Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql oracle update multiple rows

UPDATE employee
   SET staff_no = 
           CASE depno
                WHEN 1 THEN 'ab123'
                WHEN 2 THEN 'ab321'
                --...
                ELSE staff_no
           END
 WHERE depno IN ( 1, 2 ) -- list all cases here. use a subquery if you don't want to / cannot enumerate
Comment

oracle update multiple columns

UPDATE
    table_name
SET
    column1 = value1,
    column2 = value2,
    column3 = value3,
    ...
WHERE
    condition;
Code language: SQL (Structured Query Language) (sql)
Comment

PREVIOUS NEXT
Code Example
Sql :: sql column to row 
Sql :: How to backup databases using psql 
Sql :: what is having clause in sql 
Sql :: install mysql 5.7 ubuntu 20.04 
Sql :: show details of table postgres 
Sql :: sql server create database 
Sql :: sql create table with data 
Sql :: change permission to database mysql 
Sql :: oracle dynamic select into 
Sql :: sql server check whether column has same equal values 
Sql :: postgres left join 
Sql :: Write an SQL query to print details of the Workers whose SALARY lies between 100000 and 500000. 
Sql :: mysql query to find duplicate records 
Sql :: drop all triggers oracle 
Sql :: mysql timezone 
Sql :: sql delete 
Sql :: oracle select json_table example 
Sql :: add foreign key to existing table 
Sql :: sql search all tables for attributes 
Sql :: mysql add hours to time field 
Sql :: sql update record 
Sql :: how to use timestampdiff in a table in sql 
Sql :: oracle tablespace usage 
Sql :: copy column from one table to another without column duplicate postgres 
Sql :: multiple order by sql 
Sql :: mysql show foreign keys column 
Sql :: mysql create table if not exists 
Sql :: distinct in sql 
Sql :: create postgres table 
Sql :: ERROR: permission denied for table accounts postgresql 13 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =