Reputation: 12575
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 where exists (
merge in to B b
using (
)
..
..
)
Upvotes: 0
Views: 727
Reputation: 132580
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 ...)
)
..
..
)
Upvotes: 2