Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SQL query with INNER JOIN giving the SQL Code -203

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Thu May 08, 2008 9:57 am    Post subject: SQL query with INNER JOIN giving the SQL Code -203
Reply with quote

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
View user's profile Send private message

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Thu May 08, 2008 10:10 am    Post subject:
Reply with quote

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
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Thu May 08, 2008 10:23 am    Post subject: Reply to: SQL query with INNER JOIN giving the SQL Code -203
Reply with quote

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
View user's profile Send private message
nabarundas

New User


Joined: 21 Jun 2007
Posts: 28
Location: pune

PostPosted: Thu May 08, 2008 10:27 am    Post subject: Hi..
Reply with quote

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
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Thu May 08, 2008 11:46 am    Post subject: Reply to: SQL query with INNER JOIN giving the SQL Code -203
Reply with quote

Thanks to all of you.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us