youv youv - 2 years ago 72
SQL Question

Update column of one table from same table

I need to update one column of table with other from same table

UPDATE table
SET = table1.nickname
FROM table
WHERE userid = 5

Is there any problem in my query, please help.

Answer Source

Looks like you're adding some syntax you don't need...if all the data you need is already there in that table, simply do like so, irregardless of which flavor of SQL (I think--I could be wrong on that part):

UPDATE dbo.tablename
SET columnToChange = columnWithCorrectValue
WHERE userid = 5
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download