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

Home -> Community -> Usenet -> c.d.o.misc -> Re: way to implement sqlplus break on in sql

Re: way to implement sqlplus break on in sql

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 23 May 2007 16:54:32 -0700
Message-ID: <1179964472.412366@bubbleator.drizzle.com>


grasp06110 wrote:
> Hi Everybody,
>
> Is there a better way to implement the "break on" functionality of
> sqlplus in sql than what is shown below?
>
> Thanks,
> John
>
> select
> (case
> when depno = lag(depno) over (order by depno)
> then null
> else depno
> end) depno,
> name
> from
> emp
>
> /*
>
> create and populate emp table
>
> drop table emp;
>
> create table emp (
> name varchar2(20),
> depno number
> );
>
> insert into emp values (
> 'FLECK',
> 1
> );
>
> insert into emp values (
> 'WOOTEN',
> 1
> );
>
> insert into emp values (
> 'FUTURE MAN',
> 1
> );
>
> insert into emp values (
> 'JACK',
> 2
> );
>
> insert into emp values (
> 'JORMA',
> 2
> );
>
> */
>
> select
> (case
> when depno = lag(depno) over (order by depno)
> then null
> else depno
> end) depno,
> name
> from
> emp
>

Show where?

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Wed May 23 2007 - 18:54:32 CDT

Original text of this message

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