I have created a nested select query that returns records I need to inactivate on APVEMAST table. How can I add update to it so it updates only the records returned in the select. Here is the query:
select x.VENDOR, x.CHK_DT from
(select p.VENDOR, max(p.CHECK_DATE) as CHK_DT
from
(select CHECK_DATE, v.VENDOR from APPAYMENT a, APVENMAST v where v.VEN_CLASS='ONE' and VENDOR_STATUS='A' and v.VENDOR=a.VENDOR) p
group by p.VENDOR) x
where (x.CHK_DT < '1/1/2023' and CHK_DT != '1/1/1753') order by x.VENDOR
Of course, and thanks for choosing Toad. It's just that there are several ways (at least) to accomplish your goal with the SQL language. Once you light on an appropriate method, then Toad will gladly execute your logic.