Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL Plus PL/SQL Syntax Question
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:
"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