IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 2455
Location: Hampshire, UK

PostPosted: Thu Jun 16, 2011 4:03 pm
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
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

Superior Member


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

PostPosted: Thu Jun 16, 2011 6:11 pm
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
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

Superior Member


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

PostPosted: Thu Jun 16, 2011 6:19 pm
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: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jun 16, 2011 6:26 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Calucate the salary of each employee ... COBOL Programming 11
No new posts Query to find nth max salary in table... DB2 8
No new posts General question on salary and skills... Mainframe Interview Questions 9
No new posts highest salary from each dept in a table Mainframe Interview Questions 8
This topic is locked: you cannot edit posts or make replies. SQL query to find the 2nd highest sal... DB2 2
Search our Forums:

Back to Top