Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Report
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
![]() |
![]() |