1. Update시 조건을 걸어 update 시키기
update table_name set column_name = 값참조table의 column_name
from 값참조할 table
where 대상table_name = 값참조할table_name
ex)
update aaa set item= xx.item
from (select a.po, a.pon, a.item1, a.item
from tm_po a
left join tb b on a.pon = b.pon
where a.pon is not null) xx
where aaa.po = xx.po
and aaa.item is null
'Sduty > MS-SQL' 카테고리의 다른 글
Table copy, insert, update 시 column이 identity column 일경우 Identity 해제 (0) | 2017.12.20 |
---|---|
MSSQL 2017 Developer 설치시 주의점 (1) | 2017.12.08 |
MSSQL - SSMS작업시 자동한글변환될때 (0) | 2017.08.23 |
MSDTC 설정 (0) | 2016.11.02 |
EXISTS ? (0) | 2016.07.04 |