Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
nvakeel
Yak Posting Veteran
52 Posts |
Posted - 2008-01-31 : 22:39:19
|
| I have a table which has 3 col's. (table a ->col1,col2,col3)now i haveInsert into table bselect col1 where col3 = xInsert into tablebselect col2 where col3 = yNow i have to join these two insert commands to one likeInsert into table bselect ****************???can you help me. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-01-31 : 22:48:33
|
| Insert into table bselect col1 where col3 = xunion allselect col2 where col3 = yAlso you need to make sure col1 & col2 are of same datatype as the field into which you are inserting |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-02-01 : 03:06:01
|
[code]Insert into table bselect col1 from tablea where col3 = xunion allselect col2 from tablea where col3 = y[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
nvakeel
Yak Posting Veteran
52 Posts |
Posted - 2008-02-01 : 15:49:06
|
| thnkss |
 |
|
|
|
|
|