View previous topic :: View next topic
|
Author |
Message |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
Hi,
I want to have the value of variable (say X) which is present in two Tables.
Both the tables have that column with same name. So i just want to know the variable value which is present in both the DB2 tables.
We tried with INNER JOIN but its giving the SQL Code -203
Please let me know the SQL query for this.
If u need more information do let me know. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
what i understood from your post is that you want to fetch the row which is having the same value in both the tables.
SELECT * FROM MYTABLE1, MYTABLE2 WHERE MYTABLE1.MYCOL = MYTABLE2.MYCOL; |
|
Back to top |
|
|
Help-Me-Out
New User
Joined: 09 Dec 2006 Posts: 56 Location: Pune
|
|
|
|
Hi,
-203 A REFERENCE TO COLUMN column-name IS AMBIGUOUS
use alias or tablename.colname to avoid the ambiguity..
hope this helps!! |
|
Back to top |
|
|
nabarundas
New User
Joined: 21 Jun 2007 Posts: 28 Location: pune
|
|
|
|
Hi deepak.kec,
If you are dealing with more then one table in your query it is better to qualify the column name with table name as the_gautam suggested. By this you can overcome the problems like -203(REFERENCE TO AN AMBIGUOUS COLUMN )
Regards, |
|
Back to top |
|
|
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
Thanks to all of you. |
|
Back to top |
|
|
|