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