Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL help

Re: SQL help

From: Thomas Muller <ttm_at_online.no>
Date: Sun, 22 Oct 2000 23:17:59 +0200
Message-ID: <tVII5.12482$W31.185623@news1.online.no>

"ggstr" <gguerillot_at_freesurf.fr> wrote in message news:8ssiq7$a7t$1_at_news6.isdnet.net...
| I have a table with 3 fields:
| eventnumber,object,date.

|
| I will wish to count the number of time that on a same object,time
 between
| 2 eventnumber are inferior to a duration given (period).

select t1.object, count(*)
from mytable t1, mytable t2
where t1.object = t2.object
 and t1.eventnumber >= min_en
 and t2.eventnumber <= max_en
 and (t1.date between min_date and max_date)  and (t2.date between min_date and max_date) group by t1.object

--

Thomas
Received on Sun Oct 22 2000 - 16:17:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US