troubleshooting Question

How do I use this update multiple columns?

Avatar of Bruce Gust
Bruce GustFlag for United States of America asked on
MySQL Server
11 Comments4 Solutions27 ViewsLast Modified:
This works:

update tasks_master_tracker_idb idb 
SET
idb.CLIENT_CONTACT = (
   SELECT t.CLIENT_CONTACT
   FROM
   tasks t
   LEFT JOIN requests r
   ON t.ID = r.TASK
   LEFT JOIN tasks_ams tsk
   ON t.ID = tsk.RID
   WHERE 
   t.CUSTID='PRU01'
   AND
   t.INTID='INT001' 
)
WHERE
idb.CUSTID='PRU01'
AND
idb.INTEGRATION_ID='INT001' 
The challenge is that I have to update multiple columns and I'm not sure how I would do that without repeating the SELECT every time.

How would I do that?
SOLUTION
Join our community to see this answer!
Unlock 4 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 11 Comments.
Try for 7 days

”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.

-Mike Kapnisakis, Warner Bros