Re: Query-Regarding
Is this what you mean?
update nmp.sales a
join nmp.purchase b using(barcode,department)
set a.act_days_to_sell=(timestampdiff(day,b.purentrydate,a.entrydate));
If you're not sure, first run it as a Select query to check that it's finding the desired rows ...
select a.act_days_to_sell,a.entrydate,b.purentrydate,timestampdiff(day,b.purentrydate,a.entrydate) as diff
from nmp.sales a
join nmp.purchase b using(barcode,department);
Subject
Written By
Posted
Re: Query-Regarding
July 25, 2016 10:15AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.