SQL-Server

Moderators: None (Apply to moderate this forum)
Number of threads: 435
Number of posts: 788

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Update complete col in same table Posted by ampo on 22 Mar 2004 at 6:50 AM
Hi.

How can I update a complete column in a table ?
I have a table with 2 columns: col_A and col_B and I want to add '1' to every cell of col_A.
Something like:
update tblName set col_A = ((select col_A from tblName)+1) ??

The +1 is less important the operation on all the cell is the issue.

10x.
Report
Re: Update complete col in same table Posted by Shanoo on 29 Apr 2004 at 10:53 PM
: Hi.
:
: How can I update a complete column in a table ?
: I have a table with 2 columns: col_A and col_B and I want to add '1' to every cell of col_A.
: Something like:
: update tblName set col_A = ((select col_A from tblName)+1) ??
:
: The +1 is less important the operation on all the cell is the issue.
:
: 10x.
:

Update tblName set col_A = col_A + 1



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.