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 |
|
is_munir
Starting Member
1 Post |
Posted - 2008-07-03 : 06:11:11
|
| I have been created two tables namely ‘Tab1’ and ‘Tab2’ in SQL Plus 8.0 and inserted some data i.e.Tab1.id. name sal 1 ABC 15002 XYZ 20003 JKL 2500Tab2.id. inc 1 500Problem is that when I performed update statement likeSQL> UPDATE tab12 SET sal = sal + tab2.inc;I received following error:set sal=sal + tab2.inc *ERROR at line 2:ORA-00904: invalid column name |
|
|
elancaster
A very urgent SQL Yakette
1208 Posts |
Posted - 2008-07-03 : 06:13:20
|
| you should note this is a forum for Microsoft SQL ServerEm |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-03 : 06:15:18
|
| [code]UPDATE t1SET t1.sal = t1.sal + t2.incFROM tab1 t1INNER JOIN tab2 t2on t2.id=t1.id[/code]try like above. it should work (it works in MS SQL Server not sure if anything different in Oracle). if its not working try posting it in oracle forums. this is MS SQL Server forum. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2008-07-03 : 10:33:56
|
quote: Originally posted by visakh16
UPDATE t1SET t1.sal = t1.sal + t2.incFROM tab1 t1INNER JOIN tab2 t2on t2.id=t1.id try like above. it should work (it works in MS SQL Server not sure if anything different in Oracle). if its not working try posting it in oracle forums. this is MS SQL Server forum.
Update with Inner Join will work only in MS SQL Server and AccessMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|