INSERT into tasks_master_tracker_idb ( `DIRECTION`, `PROD_INBOUND_TRANSPORT_ADDR`, `PROD_OUTBOUND_TRANSPORT_ADDR`) SELECT t.DIRECTION, rt.TRANSPORT_4 FROM tasks t LEFT JOIN requirements_transport rt ON t.ID = rt.INTID__ and rt.ID = (select MAX(ID) from requirements_transport where INTID__ = t.ID) WHERE (t.INTID is not null and t.CUSTID is not null ) AND t.ID not in (select TASK_ID from tasks_master_tracker_idb)If "t.DIRECTION" is "INBOUND" than I need to insert the "rt.TRANSPORT_4" value into, "PROD_INBOUND_TRANSPORT_ADDR." If "t.DIRECTION" is "OUTBOUND," than I need to insert the "rt.TRANSPORT_4" value into "PROD_OUTBOUND_TRANSPORT_ADDR."
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.