반응형
merge into tb_a a
using dual
on (a.code = ?)
when matched then
update set name = '있다'
when not matched then
insert (code, name) values (?, '없다')
merge into tb_aaa a
using (select code, name tb_bbb where code=?) b
on (a.code = b.code)
when matched then
update set a.name = b.namel
when not matched then
insert (a.code, a.name ) values (b.code, b.namel );
반응형
'Oracle(DB관련)' 카테고리의 다른 글
순서정하기 rank() (0) | 2009.11.04 |
---|---|
sys_connect_by_path row데이터를 column데이터로 (0) | 2009.11.04 |
페이징 처리 sql (0) | 2009.10.29 |
join update (0) | 2009.10.28 |
달력 query (0) | 2009.07.17 |