开发者

oracle sql writing merge statement inside a select

开发者 https://www.devze.com 2023-02-03 04:27 出处:网络
Guys is it possible to write a merge statement inside a select like below for correlated subqueries my requirement is that i have pass to each date from top select statement and for the each date sel

Guys is it possible to write a merge statement inside a select like below for correlated subqueries

my requirement is that i have pass to each date from top select statement and for the each date select statement inside using clause should check any data exists for that date and then do insert or update

select date from A a whe开发者_开发知识库re exists (

merge in to B b 
using (

)
..
..

)


Surely you just want to use the SELECT inside the using clause?

merge into B b 
using (
select ... where datecol = (select datecol from A a where ...)
)
..
..

)
0

精彩评论

暂无评论...
验证码 换一张
取 消