Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Help with join query

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

New User


Joined: 26 Jun 2009
Posts: 2
Location: US

PostPosted: Fri Jun 26, 2009 10:16 pm    Post subject: Help with join query
Reply with quote

Hi,

I have three tables:

Code:

Table1:
Tran id   Tran date       Tran amt   Sch code
01          01/20/2009    150K         S1
02          01/20/2009    203K         S2

Table2:
Sch code  effective date  Sub sch code
S1           01/01/2009      SS1
S2           01/01/2009      SS2

Table3:
Sub sch code    Amt upper limit    pts
SS1                        99999   10
SS1                      999999   20
SS1                     9999999   30


Basically this table should be:
Table3:
Sub sch code    Amt lower limit     Amt upper limit    pts
SS1                      0                         99999          10
SS1                      100K                  999999          20
SS1                     200K                  9999999          30

but it stores only the upper limit.
 


Now the requirement is that for each transaction we have to find the pts from table3 based on the sch code and tran amt. To get the pts tran Tran amt should fall between the lower limit and upper limit amt defined in Table3.

Can you please help with this?
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Sun Jun 28, 2009 11:34 am    Post subject:
Reply with quote

Hello,

Your example data does not appear to be consistent.

Suggest you re-post the sample table data with a bit more variety in the data. You will also want to provide the processing "Rules" of how the data should be operated on.

When posting the inputs you have and the output you want, use the "Coide" rag (as you have done) but also use the Preview to make sure the post appears to the forum as you want it.
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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm

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