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: SQL Plus PL/SQL Syntax Question

Re: SQL Plus PL/SQL Syntax Question

From: John Russell <netnews_at_johnrussell.mailshell.com>
Date: Tue, 28 Aug 2001 04:12:40 GMT
Message-ID: <rd6motkrtfmsvckj1ldhdmn046ddbe8ncv@4ax.com>


On Mon, 27 Aug 2001 21:02:34 -0500, "Jon Schlatter" <*jon-schlatter_at_stamats.com> wrote:

> I need to perform a select statement that does a group by and the supresses
>duplicate entries. I am writing a job status report and have the following
>select statement written.
>
>SELECT PA_JOB.PROJECT_NO, PA_JOB.JOB_NO, PA_JOB.DES1,
>PA_JOB.JOB_MANAGER_REF, PA_JOB.EST_COMPLETION_DATE,PA_JOB.DEADLINE_DATE,
>PA_JOB.CUSTOMER_REF, PA_JOB.UD_NOTE
> FROM K.PA_JOB PA_JOB
>WHERE ( PA_JOB.STATUS IN ('A','I') )
>ORDER BY PA_JOB.CUSTOMER_REF ASC, PA_JOB.JOB_MANAGER_REF
>ASC,PA_JOB.PROJECT_NO ASC, PA_JOB.JOB_NO ASC
>
>All the data shows up properly, but now I need to supress duplicate entries.
>Currently my report looks like this.
>
>Client1 Project1 Description
>Client1 Project2 Description
>Client1 Project3 Description
>Client2 Project1 Description
>Client2 Project2 Description
>Client2 Project3 Description
>
>What I want to see is like this.
>
>Client1 Project1 Description
> Project2 Description
> Project3 Description
>Client2 Project1 Description
> Project2 Description
> Project3 Description
>
>Can I do this in SQL Plus PL/SQL?
>

In SQL*Plus, yes. Use the command BREAK ON <colname> and define an alias for the column in your SELECT statement.

Details:

http://tahiti.oracle.com/pls/tahiti/tahiti.drilldown?levelnum=2&toplevel=a82950&method=FULL&chapters=0&book=&wildcards=1&preference=&expand_all=&verb=&word=break+on#a82950

"Suppressing Duplicate Values in Break Columns"

John

--
Got an Oracle database question?
Try the search engine for the database docs at:
http://tahiti.oracle.com/
Received on Mon Aug 27 2001 - 23:12:40 CDT

Original text of this message

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