With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.
declare @Seek as varchar(20) set @seek = 'AR42154' select * from amipartnumbers as APN left join ( select * from JD cross apply ( values (1, OEMPartNumer ) ,(2, OEMSubNumber ) ,(3, OEMSubNumber2) --,(4, OEMSubNumber3) --,(5, OEMSubNumber4) ) as xapply (lvl, OEMRef) ) JDT on APN.OEMItem = JDT.OEMRef where OEMPartNumer = @Seek or OEMSubNumber = @seek or OEMSubNumber2 = @seek --or OEMSubNumber3 = @seek --or OEMSubNumber4 = @seek
UPDATE imports SET imports.AMIPartNumber = coalesce(AMIA.Item,AMIB.Item,AMIC.Item,AMID.Item,AMIE.Item), Imports.AMIDescription = coalesce(AMIA.Description,AMIB.Description,AMIC.Description,AMID.Description,AMIE.Description) FROM imports as I LEFT JOIN JD as JDA ON I.OEMPartNumber = JDA.OEMPartNumber LEFT JOIN amipartnumbers as AMIA ON JDA.OEMPartNumber = AMIA.OEMItem LEFT JOIN JD as JDB ON I.OEMPartNumber = JDB.OEMSubNumber LEFT JOIN amipartnumbers as AMIB ON JDB.OEMSubNumber = AMIB.OEMItem LEFT JOIN JD as JDC ON I.OEMPartNumber = JDC.OEMSubNumber2 LEFT JOIN amipartnumbers as AMIC ON JDB.OEMSubNumber2 = AMIC.OEMItem LEFT JOIN JD as JDD ON I.OEMPartNumber = JDD.OEMSubNumber3 LEFT JOIN amipartnumbers as AMID ON JDB.OEMSubNumber2 = AMID.OEMItem LEFT JOIN JD as JDE ON I.OEMPartNumber = JDE.OEMSubNumber4 LEFT JOIN amipartnumbers as AMIE ON JDB.OEMSubNumber2 = AMIE.OEMItem ; select * from imports
Join the community of 500,000 technology professionals and ask your questions.