SQL Question - Ranges of Sequences -
From: Eddie <edawad_at_hotmail.com>
Date: Sun, 25 Jul 1999 04:23:45 GMT
Message-ID: <7ne3gf$74n$1_at_nnrp1.deja.com>
Hi everybody, I would like your help on this query. I have a table:
Create table test_table (id number, description varchar2 (20)); with the following rows:
Date: Sun, 25 Jul 1999 04:23:45 GMT
Message-ID: <7ne3gf$74n$1_at_nnrp1.deja.com>
Hi everybody, I would like your help on this query. I have a table:
Create table test_table (id number, description varchar2 (20)); with the following rows:
Insert into table test_table values (1,'D1'); Insert into table test_table values (2,'D1'); Insert into table test_table values (3,'D1'); Insert into table test_table values (4,'D2'); Insert into table test_table values (7,'D2'); Insert into table test_table values (8,'D2'); Insert into table test_table values (20,'D3'); Insert into table test_table values (21,'D3'); Insert into table test_table values (22,'D3'); Insert into table test_table values (23,'D4'); Insert into table test_table values (30,'D4');
I want the result to look like this:
from to description count
1 3 D1 3 4 4 D2 1 7 8 D2 2 20 22 D3 3 23 23 D4 1 30 30 D4 1
I appreciate your help,
Thank you
--
Eddie
Application Developer
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Sun Jul 25 1999 - 06:23:45 CEST