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 |
|
mirza21
Starting Member
11 Posts |
Posted - 2009-05-22 : 03:55:41
|
| Can we use insert statement with innner join to get refrence to any of the base tables so that we can insert in one of these tableplz help with an example |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2009-05-22 : 03:57:42
|
yes you caninsert into sometable ( <somecol> )select t1.acol, t1.othcol, t2.anothercolfrom atable t1 inner join anothertable t2 on t1.pk = t2.pkwhere <some condition> KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-05-22 : 04:10:25
|
| [code]insert into table1 (columns...)select t2.columns..from table2 t2left join table1 t1on t1.pk=t2.fkwhere t1.pk is null[/code] |
 |
|
|
|
|
|