Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
need help to sort out this issue

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

New User


Joined: 27 Mar 2010
Posts: 19
Location: folirida

PostPosted: Wed Feb 27, 2013 12:22 pm    Post subject: need help to sort out this issue
Reply with quote

Hi all,

I have a requirement in DB2.There are 2 tables called tab A and tab B with below colums.

Tab A
-------
Emp_Name
Emp_Age
Emp_Position


Tab B
------
company_name
Salary
Emp_Position

Here is my requirement i need to select Emp_name,Emp_Age and Salary.

Problem: while declaring the table(Tab A,Tab B) it gives problem due to common variable(Emp_Position).

please help me to sortout this issue?


Thanks
Paul
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


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

PostPosted: Wed Feb 27, 2013 12:31 pm    Post subject:
Reply with quote

Are you facing probelm in writing the SQL to get the desired data or declare (create) definition for tables is the problem?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19254
Location: Inside the Matrix

PostPosted: Wed Feb 27, 2013 1:26 pm    Post subject:
Reply with quote

Hello,

You need to post the actual query along with the diagnostic information.

Also, there is likely an issue with the approach. Many positions have multiple salaries.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Feb 28, 2013 9:34 am    Post subject:
Reply with quote

Hello Paul,

When writing select query, you must give alias name, which can be give for a table or column.

select a.empname, a.emp_age, b.emp_position
from TABA as A, TABB as B
where a.emp_position = b.position

Regards,
Sushanth
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Thu Feb 28, 2013 1:18 pm    Post subject:
Reply with quote

After looking at Sushanth's post, first post in this thread make sense; Thanks Sushanth.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Thu Feb 28, 2013 1:22 pm    Post subject:
Reply with quote

You are Welcome Anuj
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 One-One matching using SORT dearlux SYNCSORT 14 Fri Oct 11, 2019 12:11 am
No new posts Issue in NDM : Connect Direct janmejay All Other Mainframe Topics 0 Sat Sep 28, 2019 12:05 pm
No new posts Create Dynamic Sort card with Omit co... balaji81_k DFSORT/ICETOOL 9 Thu Sep 26, 2019 10:06 pm
No new posts Z/OSMF start issue asmanyam IBM Tools 4 Tue Aug 13, 2019 2:46 pm
No new posts need assistance on a sort rajiv rengasamy SYNCSORT 11 Fri Jul 26, 2019 8:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us