티스토리 뷰

 
* MSSQL *

UPDATE table_a 
   SET table_a.column_a = table_b.column_b

  FROM table_a,

            table_b, 
 WHERE table_a.userid  = table_b.userid

 

 

* 오라클 *

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); 

출처
https://m.blog.naver.com/PostView.nhn?blogId=cubot&logNo=140048824897&proxyReferer=https%3A%2F%2Fm.search.naver.com%2Fsearch.naver%3Fquery%3D%25EC%2598%25A4%25EB%259D%25BC%25ED%2581%25B4%2Bselect%2Bupdate%26where%3Dm%26sm%3Dmtp_hty
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/11   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
글 보관함