Reputation: 153
In Mssql i want to update a column col1 in table named Table1 using select query which returns col1 from Table1 and add 1 to it. So i used the following code
update Table1 set col1=(select col1 from Table1) + 1;
But when i used it says you cannot target same table.Is there any ways to work out this function. Please help to find it out.
Thanks in advsnce
Upvotes: 1
Views: 700