본문 바로가기

DataBase

select 구문으로 update 하기(오라클)

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

UPDATE table_a
   SET column_a = column_b
 WHERE userid IN (SELECT userid
                    FROM b)


UPDATE table_a
   SET (column_1, column__2) = (SELECT column_a, column_b
                                  FROM table_b
                                 WHERE join_column_1 = table_a.join_column_a);


UPDATE table_a
   SET column_1 = (SELECT COLUMN
                     FROM table_b
                    WHERE userid = table_a.userid);


UPDATE table_a
   SET (column_1) = (SELECT COLUMN
                       FROM table_b
                      WHERE userid = table_a.userid AND url IS NOT NULL);