troubleshooting Question

update version of SQL update question (sorry for confusion)

Avatar of jgordin
jgordin asked on
SQL
3 Comments1 Solution203 ViewsLast Modified:
This is an updated version of questions posted by me before
(SQL update/set more than one column 7/30/07 and SQL update logic 7/28/07).
I hope this version is clear.
I have four tables:
Table1, Table2, Table3, and Table4
Table1 and Table2 have common column id. Table2 has columns that can be matched with columns in Table3 and Table4.
I need to join Table1 and Table2 and update column in Table1 depending on different conditions
(1)      when Table2.colA = Table3.ColA and Table2.colB = Table3.ColB Then 1 (set to 1 if a match and dont check anything else)
(2)      when Table2.colA=Table4.ColA and Table2.colB = Table4.ColB  Then 2 (set to 2 if a match and dont check anything else)
else  3

If there is no match for when (1) and when (2) then set the value to 3.
ASKER CERTIFIED SOLUTION
wsh2

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 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 1 Answer and 3 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