Home » SQL & PL/SQL » SQL & PL/SQL » Trying to Report on Date Periods within a table (Oracle 12C)
Trying to Report on Date Periods within a table [message #676701] Sat, 06 July 2019 15:48 Go to previous message
mvs2019
Messages: 5
Registered: July 2019
Junior Member
I have a table that has several sets of dates. I am trying to generate a resultset that shows distinct time frames in which
the customer either had or different aid categories:

Table Cust
Customer_Nbr    EFF_DATE    	END_DATE     AID_CATG     CATG_EFF_DATE	 CATG_END_DATE
000001		01/01/2012      12/31/2014	A1	   04/01/2012	 04/30/2012
000001		01/01/2012      12/31/2019	A2	   06/01/2012	 08/31/2012
000002		01/02/2012      12/31/2019	A3	   01/02/2012	 08/31/2012
..

Resultset I am trying to produce
Customer_Nbr    EFF_DATE    	END_DATE     AID_CATG      
000001		01/01/2012	03/31/2012
000001		04/01/2012	04/30/2012    A1
000001		05/01/2012	05/31/2012
000001		06/01/2012	08/31/2012    A2
000001		09/01/2012	08/31/2019     
I am looking at using analytical functions to make it scalable.

[Updated on: Sat, 06 July 2019 16:00] by Moderator

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Automatic abropting the long running job
Next Topic: MAX(DECODE
Goto Forum:
  


Current Time: Fri Apr 26 21:05:18 CDT 2024