Prepare for your Next Interview
This is a discussion on Can Select statement be used along with Update statement? within the SQL forums, part of the Databases category; Can Select statement be used along with Update statement in an SQL Query?...
|
|||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
|||
|
Re: Can Select statement be used along with Update statement?
following query will help you to update multiple columns at once
update tblOuter set colOuter1 = a.colInner1, colOuter2 = a.colInner2, colOuter3 = a.colInner3, from ( select colInner1,colInner2,colInner3 from tblInner where conditions on tblInner columns ) as a where condition on tblOuter's columns be careful with your where conditions.......... |
| The Following User Says Thank You to nitin_padwal For This Useful Post: | ||
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Is this a correct statement | anoop4real | C and C++ | 13 | 05-22-2008 06:22 AM |
| Why we have to close connection, statement, prepared statement | Geek_Guest | Java | 8 | 02-27-2008 06:09 AM |
| I just want to commit my second Insert statement | Geek_Guest | Oracle | 1 | 07-21-2007 05:48 AM |
| How many Case statments can i use in Switch Statement | Geek_Guest | C and C++ | 9 | 07-03-2007 04:56 AM |
| Rules for COPY statement | norman | MainFrame | 1 | 08-14-2006 04:11 AM |