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

Home -> Community -> Usenet -> c.d.o.server -> Re: nice sql problem

Re: nice sql problem

From: Ronald <devnull_at_ronr.nl>
Date: 30 Jan 2002 02:17:06 -0800
Message-ID: <67ce88e7.0201300217.197065eb@posting.google.com>


mike2322_at_hotmail.com (Mike Liu) wrote in message news:<2262aa8e.0201291122.6ab233fd_at_posting.google.com>...
> devnull_at_ronr.nl (Ronald) wrote in message news:<67ce88e7.0201290442.2bd6ad09_at_posting.google.com>...
> > given table contains
> Try this,
>
> select min(a), max(b)
> from (
> select a, b, rownum-level gp
> from z
> connect by a = prior b
> start with a not in (
> select b from z
> )
> )
> group by gp
> /
>
> hth,
> Mike

Hi Mike,
thanks for the input. It works. You can get rid of the inline view to get: select min(a), max(b)
from z
connect by a = prior b
start with a not in (
  select b from z
  )
group by rownum-level
/

will this also work in db2 and sqlserver ? (was not in the original Question) Received on Wed Jan 30 2002 - 04:17:06 CST

Original text of this message

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