January 23, 2008 at 2:31 pm
Hello,
I need help writing a basic query. I do not have much experience using any types of JOINS inside an UPDATE query, so I appreciate any help offered.
If the values for B table fields are null, i.e. already removed, then the status on A table should be set to "Contacted"
The joining filed on this two tables will be customer_id
In advance, thank you very much. 🙂
January 23, 2008 at 2:36 pm
Please read ... http://www.sqlservercentral.com/articles/Best+Practices/61537/ ... and repost your question. 😀
This also seems like a homework question. What have you tried already?
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgJanuary 23, 2008 at 2:38 pm
update a
set fieldone = 'contacted'
from tableONE a
left join tableTWO b on a.customerID = b.customer_id
where b.customer_id is null
January 23, 2008 at 4:40 pm
From the description, the code looks correct... did you try it?
--Jeff Moden
Change is inevitable... Change for the better is not.
January 23, 2008 at 5:05 pm
Yes I did try it and it seems to work fine. I just have not finished the app. coding. to a point where I can test it from there.
Anyhow, I appreciate your help. It saved me a lot of time.
What other steps do I need to take to process this question correctly?
Thank you.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply