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: Guido Konsolke <Guido.Konsolke_at_triaton.com>
Date: Tue, 6 May 2003 08:04:20 +0200
Message-ID: <1052200650.783826@news.thyssen.com>


"Praveen" <nospam_at_spam.com> schrieb im Newsbeitrag 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.
>
> Regards,
>
> P
>

Hi Praveen,

why don't you have a look at your doc set? For example: read about BREAK, COLUMN
and so on. With this formatting options you can easily get what you want. And for your
SQL statement:
SELECT dept_id, employee.employeeid, employee.name, ... FROM dept, employee
WHERE dept.employeeid = employee.employeeid -- ORDER BY whatever
GROUP BY dept_id;

hth and happy reading,
Guido Received on Tue May 06 2003 - 01:04:20 CDT

Original text of this message

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