Need DB2 SQL Query



IBM's flagship relational database management system

Need DB2 SQL Query

Postby venki3 » Fri Apr 15, 2016 10:49 pm

I am looking for a SQL query for the scenario:
" I need all the card numbers (CARD_NUM) with duplicate entries in table "CC_DETAILS" with overlapping dates for PAID and INCUR dates. Example:

CARD_NUM   CHAR         12      767000411349
PAID_BGN_DT   DATE         10      2014-01-01
PAID_END_DT   DATE         10      2017-01-01
INCUR_BGN_DT  DATE         10      2014-01-01
INCUR_END_DT  DATE         10      2016-01-01

CARD_NUM   CHAR         12      767000411349
PAID_BGN_DT   DATE         10      2016-01-01
PAID_END_DT   DATE         10      2017-01-01
INCUR_BGN_DT  DATE         10      2015-01-01
INCUR_END_DT  DATE         10      2017-01-01


Coded
venki3
 
Posts: 4
Joined: Tue Dec 22, 2009 2:10 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need DB2 SQL Query

Postby prino » Sat Apr 16, 2016 3:32 am

And what do you plan to pay for this information?

This is a HELP forum, not a we do your work for you one...
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 635
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 28 times

Re: Need DB2 SQL Query

Postby NicC » Mon Apr 25, 2016 7:39 pm

You will also have to explain more. Please supply sample input data and expected output data. Use the code tags (with code=old) to preserve spacing.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need DB2 SQL Query

Postby Raja190 » Sun May 08, 2016 5:51 pm

Hi Venki,
your qustion is not clear and as suggested please post some example like whats the input data and what is the expected output.

also post if you have tried any SQL for this. so we could fine tune it.
Raja190
 
Posts: 36
Joined: Mon Dec 14, 2015 8:13 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post