Advertisement

05.15.2008 at 02:59PM PDT, ID: 23406837
[x]
Attachment Details

Need to Select query on the same table multiple times to find new changes

Asked by Issolinc in PL / SQL, Oracle 9.x

Here is what i am trying to do
I have table with fields and some other which i don't need.

Contract#
Division#
Group#
Trans Date
Effective Date

Date will look like

Contract#      Group#      Division #      Trans Date      Effective Date      End Date
123      g10      d1      2/19/2007      3/1/2007                            12/31/2007
123      g11      d2      12/28/2007      1/1/2008                            12/31/2008
345      g18      d1      3/10/2007      4/1/2007                            2/17/2007
345      g19      d1      1/19/2008      2/18/2007                           12/31/2008

There will be more then two rows for each contract# with the  diffrent values in other fields in the table.
First i need to check if there is a change in the group# for the most current transactions of 2007 based on trans date for each contract# which means the New group# belongs to Max(TransDate) in 2007 and checked against group# belongs to one before that, if  there is a change in Group#  then get that contract and provide the details mentioned below.For some there might be Division# change also  so i just need to get division# from both the records

So my out put should look  like

Contract#      Group#      New Group#      Old Division      New Division      Ymd Trans      Ymd Eff
123       g10      g11       d1      d2      12/24/2007      1/1/2008
345      g18      g19      d1      d1      12/10/2007      2/18/2008

Thanks!!

Start Free Trial
 
 
[+][-]05.15.2008 at 11:10PM PDT, ID: 21580347

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 08:55AM PDT, ID: 21583885

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:01AM PDT, ID: 21583942

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.16.2008 at 09:10AM PDT, ID: 21584024

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 09:26AM PDT, ID: 21599217

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 10:38AM PDT, ID: 21599877

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 11:13AM PDT, ID: 21600135

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.19.2008 at 11:29AM PDT, ID: 21600257

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PL / SQL, Oracle 9.x
Sign Up Now!
Solution Provided By: sdstuber
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.20.2008 at 01:30PM PDT, ID: 21610066

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 02:11PM PDT, ID: 21610388

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628