Re: SQL question

From: Angelo Cavallaro <angelo.cavallaro_at_pcm.bosch.de>
Date: 1998/03/03
Message-ID: <34FC1FE4.2920_at_pcm.bosch.de>#1/1


Hi !

If you want all intervalls between the dates of a date-column for all rows then use this:

select next.date_col - max(previous.date_col) from your_tab next, your_tab previous
where previous.date_col < next.date_col
group by next.date_col;

U will get the result in days.

Greez,
Angelo.

Marco Nedermeijer wrote:
>
> I'm trying to create a sql-statement to do the following:
>
> i want to substract a date-field from a date-field of a previous record. my
> guess is that i need to use ROWNUM for this.
>
> Can someone help me to create this statement ?
>
> Thanks,
>
> Marco Nedermeijer
> m.n.nedermeijer_at_rtd.nl
 

-- 
-----------------------------------------------------------------
Angelo Cavallaro     /  /  /   \     TECTUM Beratungsgesellschaft
ORACLE-SW-Berater   /  /  /     \    für Informationsverarbeitung
ancavall.NOSPAM    /  /  /-------\   Tel: 0711/99073-10
_at_aol.com          /__/__/_________\  Fax: 0711/99073-99

-----------------------------------------------------------------
	 Visit the Home of the Green Ribbon Campaign:

		http://www.ponce.oisoft.com/

-----------------------------------------------------------------
Received on Tue Mar 03 1998 - 00:00:00 CET

Original text of this message