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
 

 

Want emp name and salary who's emp no is 107

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Amit tandon
Warnings : 1

New User


Joined: 29 Jul 2010
Posts: 6
Location: mumbai

PostPosted: Thu Jun 16, 2011 3:51 pm    Post subject: Want emp name and salary who's emp no is 107
Reply with quote

Hi all,

I have 2 tables. table A have emp no,emp name and table B have empno,name,salary.
I want to emp name and salary who's emp no is 107.
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1825
Location: UK

PostPosted: Thu Jun 16, 2011 4:03 pm    Post subject:
Reply with quote

First - a topic called DB2 in a forum section called DB2 is not at all helpful or meaningful.
Second - what problem are you having with your SELECT statement? This looks to me to basic SQL. The DB2 User's Guide should help you here an any basic text on using SQL.
Back to top
View user's profile Send private message
Amit tandon
Warnings : 1

New User


Joined: 29 Jul 2010
Posts: 6
Location: mumbai

PostPosted: Thu Jun 16, 2011 4:13 pm    Post subject: Reply to: Db2
Reply with quote

Thanks,

Actually i m using join for that. so want to say i have to use nested select statement.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 16, 2011 6:11 pm    Post subject: Re: Reply to: Db2
Reply with quote

Amit tandon wrote:
Actually i m using join for that. so want to say i have to use nested select statement.
Why don't you share, what you have tried, with us?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 16, 2011 6:14 pm    Post subject:
Reply with quote

Since table B has emp_no, emp_name and salary why do you need to include table A?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 16, 2011 6:19 pm    Post subject:
Reply with quote

Good one Craig, I did not notice that! icon_biggrin.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2435
Location: Netherlands, Amstelveen

PostPosted: Thu Jun 16, 2011 6:26 pm    Post subject:
Reply with quote

Finding the empno's in table A not in table B hence not getting any salary?
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 Calucate the salary of each employee ... nareshdacha COBOL Programming 11 Sat Jul 17, 2010 12:04 pm
No new posts Query to find nth max salary in table... anshul_gugnani DB2 8 Fri Feb 12, 2010 2:14 pm
No new posts General question on salary and skills... Unshriven Mainframe Interview Questions 9 Mon Jan 04, 2010 12:38 am
No new posts highest salary from each dept in a table l.nethaji Mainframe Interview Questions 8 Thu Dec 31, 2009 9:50 am
This topic is locked: you cannot edit posts or make replies. SQL query to find the 2nd highest sal... arindambanerjee DB2 2 Wed Dec 09, 2009 9:55 pm


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