I am not sure how to do this with an SQL Update Set statemet:
I have a table customers and I have related invoices. I would like to set one field to "not active" in the customer table that did not receive invoices since 2008.
I can "Select" the corresponding records in the customer table without problem:
SELECT 'not active' c.myCustomerField FROM c LEFT OUTER JOIN (Select distinct i.ACCOUNT test from i where i.invoiceyear>=2008) d ON s.ACCOUNT=d.test WHERE d.test is NULL
How do I get the Join into the update statement?
update c (??? Join here???) set c.mycustomerfield = 'not active' where ??????
How can I set myCustomerField?
as400 db2 sql statement
March 28, 2011 2:03 PM
March 28, 2011 9:38 PM