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: SQL Report

Re: SQL Report

From: Alex Filonov <afilonov_at_yahoo.com>
Date: 7 May 2003 09:42:24 -0700
Message-ID: <336da121.0305070842.3f06717a@posting.google.com>


Praveen <nospam_at_spam.com> wrote in message news:<3EB7466A.2020407_at_spam.com>...
> Hi..All,
>
> I have 2 tables employee (employeeid), dept (dept_id, ,employeeid).
> I want to get a report in the following format
>
> <dept_id1>
> employeeid1
> employeeid2
> ...
> ...
>
> <dept_id2>
> employeeidXX
> employeeidYY
> ....
> ...
> ..
>
>
> Is this possible to do it in a single SQL.
>

Sure. In sqlplus:

column dept_id new_value department noprint ttitle left '<' department '>'
break on dept_id skip page
set heading off

select dept_id, employee_id
from emp;

Recommended reading: SQL*Plus Guide and Reference.

> Regards,
>
> P
Received on Wed May 07 2003 - 11:42:24 CDT

Original text of this message

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