[SQL]

Jen Y·2021년 9월 2일
0

SQL

목록 보기
1/1

MSSQL 테이블 작성 인덱스 생성 하기
https://ponyozzang.tistory.com/426

join의 on절과 where절 차이

SQL Server LEAD Function

SELECT 후 DELETE 하기

--table에만 있는 데이터 table2에 insert
insert into table2
select B.*
from table2 A
right outer join table B on A.id=B.id
where A.id is null

--table2에만 있는 데이터 삭제
delete from table2
where id in ( select A.id
from table2 A
left outer join table B on A.id=B.id
where B.id is null)

0개의 댓글