Monday, September 1, 2014

Update join 2 table SQL _SERVER

select lipqoh,TRQT,liitm,itm,lilocn,locn
--UPDATE proddta.f41021 SET lipqoh =trqt
from proddta.f41021 
INNER JOIN zdev.dbo.temp_pqoh  on liITM=itm and rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and lilocn=locn
where rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and liITM=itm  and lilocn=locn and
rtrim(ltrim(limcu))=rtrim(ltrim(mcu)) and lipqoh<>trqt

No comments: