Toad World® Forums

I need to change the query for an update and minus


#1

Hello everyone
Do you help me please?
I have the query:
Ovbiusly this insert is working.
insert into new5 (c1, c2, c3, c4, c5, c6)
select p.cvst, p.ctc, cr.lrr, cr.RD, cr.st, cr.ban
from SCM p
inner join sthcm cr on cpr.num_cte = cr.nm_cs
where cr.cve =‘9’
MINUS
select c1, c2, c3, c4, c5, c6
from old_6
where cve =‘9’;

But I need an UPDATE with MINUS
I need to change the query for an update

The example is not working
update new5 set (c1, c2, c3, c4, c5, c6)
values( select p.cvst, p.ctc, cr.lrr, cr.RD, cr.st, cr.ban
from SCM p
inner join sthcm cr on cpr.num_cte = cr.nm_cs
where cr.cve =‘9’
MINUS
select c1, c2, c3, c4, c5, c6
from old_6
where cve =‘9’);


This example is not working.
update
(
values select p.cvst, p.ctc, cr.lrr, cr.RD, cr.st, cr.ban
from SCM p
inner join sthcm cr on cpr.num_cte = cr.nm_cs
where cr.cve =‘9’
MINUS
select c1, c2, c3, c4, c5, c6
from old_6
where cve =‘9’
)
set new5 (c1, c2, c3, c4, c5, c6);

Thank you for your feedback.