Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combining data from two columns

Status
Not open for further replies.

kgkane

Programmer
Feb 8, 2005
7
US
Hi all again. I have another SQL Query question for you. I need to update a column in one table with data from two columns in another table. How would I go about this? Thanks again in advance for any help.


Kevin
 
Which RDBMS ? Which tables ? Which columns ? Which joins ?
What have you tried so far ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
OK Sorry. It's on MSSQL Server. basically what I need is this:
UPDATE Table1 Set Columname = Table2.Columname1 + Table2.Columname2
Hope this sheds a little more light on the subject.


Kevin
 
Something like:

Code:
UPDATE t1
SET c2 = t2.c2 + t2.c3
FROM t1 JOIN t2 ON t1.c1 = t2.c1

--James
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top