Xref: alice comp.databases.oracle.tools:19308
Path: alice!news-feed.fnsi.net!dca1-hub1.news.digex.net!digex!newsfeed.cwix.com!134.222.90.2!EU.net!news0.Belgium.EU.net!Belgium.EU.net!news.eurocontrol.be!news.cfmu.eurocontrol.be!not-for-mail
From: Jochen Van den Bossche <Jochen.Van-Den-Bossche@eurocontrol.be>
Newsgroups: comp.databases.oracle.tools
Subject: Re: SQL select question
Date: Thu, 10 Dec 1998 09:16:45 +0000
Organization: EUROCONTROL CFMU
Lines: 79
Message-ID: <366F917D.6C6C@eurocontrol.be>
References: <74m7gr$95l$1@nnrp1.dejanews.com> <74mn2a$ia0$1@news1.skynet.be>
Reply-To: Jochen.Van-Den-Bossche@eurocontrol.be
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: dolphin.pst.cfmu.eurocontrol.be 913277854 20620 193.221.186.189 (10 Dec 1998 08:17:34 GMT)
X-Complaints-To: usenet@dolphin.pst.cfmu.eurocontrol.be
NNTP-Posting-Date: 10 Dec 1998 08:17:34 GMT
X-Mailer: Mozilla 3.01C-NSCP  (WinNT; I)

Wim Jans wrote:
> 
> Hi,
> 
> Try this
> 
> SQL> break on deptno skip 1
> SQL> select *
>           from emp
>           order by deptno
> 

Try to put the column you use as break column (in this case deptno) as
the first column: It looks better. (but you can't use 'select *' unless
it is the first column you want to break on.)

IMPORTANT: do not forget to execute a 'break off' after the select!
Otherwise it remains active and will affect any select with a deptno
column...

SQL> 
SQL> break on deptno skip 1
SQL> select deptno, empno, ename
  2  from emp
  3  order by deptno;

    DEPTNO      EMPNO ENAME
---------- ---------- ----------
        10       7782 CLARK
                 7839 KING
                 7934 MILLER

        20       7369 SMITH
                 7876 ADAMS
                 7902 FORD
                 7788 SCOTT
                 7566 JONES

        30       7499 ALLEN
                 7698 BLAKE
                 7654 MARTIN
                 7900 JAMES
                 7844 TURNER
                 7521 WARD


14 rows selected.

SQL> clear breaks
breaks cleared
SQL> 


> dennishancy@eaton.com wrote in message <74m7gr$95l$1@nnrp1.dejanews.com>...
> >I'm hoping this will be a simple SQL question to answer.
> >
> >I have a table with very few columns.  I want to print each of the fields
> in
> >this table, which I know will be a simple "select * from TABLE" command.
> >
> >Ok, but I want to modify the output slightly.  I think I need a "group by"
> or
> >"break on" clause, but I'm not sure.  I'd like to have each group of
> records
> >having the same value for "field1" print together.  In other words, having
> a
> >blank line in between each group is my goal.
> >
> >Can anyone shed some light on this for someone who doesn't use SQL that
> much?
> >Thanks.
> >
> >
> >Dennis Hancy
> >Eaton Corporation
> >Cleveland, OH
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own
