I have merge query with below syntax:
MERGE INTO target_table
USING source_table
ON search_condition
WHEN NOT MATCHED THEN
INSERT (col1,col2,...)
values(value1,value2,...)
WHERE <insert_condition>;
But i want change this query to see how many rows would insert and use the below query but i am not sure this is correct query:
select count(*) from target_table where not exists (select 1 from source_table where search_condition)