Home » SQL & PL/SQL » SQL & PL/SQL » samll query required
samll query required [message #231752] Wed, 18 April 2007 05:41 Go to next message
sanammg
Messages: 31
Registered: June 2005
Member
hi

i have the data in the table like this

client pec start_date end_date
------------------------------------------------------
N0000010011 85.00 8/25/2003 1/1/2003
N0000010011 85.00 1/1/2004 8/25/2003
N0000010011 90.00 1/1/2005 1/1/2004
N0000010011 90.00 1/1/2006 1/1/2005
N0000010011 90.00 1/1/2007
N0000010011 90.00 1/1/2007 1/1/2006

i need the output like

client pec start_date end_date
------------------------------------------------------
N0000010011 85.00 8/25/2003 8/25/2003
N0000010011 90.00 1/1/2005

i have to group client and pec, and i need MIN(start_date) and MAX(end_date)
if end date is null then i need nulldate


Thanks
sathya
Re: samll query required [message #231775 is a reply to message #231752] Wed, 18 April 2007 06:55 Go to previous messageGo to next message
Michel Cadot
Messages: 64132
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please always post:
1/ Formatted, read "How to format your posts" in SQL & PL/SQL Newbies
2/ In correct forum, this a newbie question
3/ Your Oracle version
4/ create table and insert statements to make test

What do you got when you tried the query you suggest (min, max)? What was wrong?

Regards
Michel
Re: samll query required [message #231782 is a reply to message #231752] Wed, 18 April 2007 07:11 Go to previous message
sanammg
Messages: 31
Registered: June 2005
Member
Thanks Michel Cadot

it is solved here..
thanks for u r suggestion.
Previous Topic: DDL Statement Log
Next Topic: Seeing things (list partition)
Goto Forum:
  


Current Time: Wed Dec 07 18:37:25 CST 2016

Total time taken to generate the page: 0.20099 seconds