The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.databases.oracle.misc
From: Frank van Bortel <frank.van.bor...@gmail.com>
Date: Thu, 19 Oct 2006 20:11:01 +0200
Local: Thurs, Oct 19 2006 2:11 pm
Subject: Re: Reduce To Ranges aggregate function
Michel Cadot schreef:
> SQL> col Range format a20 Love it! Beautiful! > SQL> with > 2 step1 as ( > 3 select id, > 4 case > 5 when nvl(lag(id) over (order by id),-1) != id-1 then id > 6 end grp > 7 from t), > 8 step2 as ( > 9 select id, > 10 max(grp) over (order by id) grp > 11 from step1 > 12 ) > 13 select min(id)||decode(min(id),max(id),'','-'||max(id)) "Range" > 14 from step2 > 15 group by grp > 16 / > Range > -------------------- > 1-5 > 11-12 > 45 > 3 rows selected. > Regards -- Top-posting is one way to shut me up... You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||