Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Is there a way to update one column using conditions based on two or more tables?ie. UPDATE <table1>SET col02 = (SELECT ColNew From <table2> WHERE <Table2>.ColNew = <table3>.Colold AND <Table2>.Col001 = <Table3>.Col001Is this possible?, If so, please clue a newbie in.. THANKS TONS!!!
Sully
Starting Member
30 Posts
Posted - 2005-05-25 : 12:15:31
I believe you would have to use a join and you would have to insure one value returned in your select. Plus, are you trying to update every row in table1? Stuck in neutral in a pedal to the metal world,Sully
Compkitty
Starting Member
24 Posts
Posted - 2005-05-25 : 12:26:50
I was able to formulate the answer.. THANKS THOUGH
Sully
Starting Member
30 Posts
Posted - 2005-05-25 : 12:46:16
Great, and you're welcome.Stuck in neutral in a pedal to the metal world,Sully