Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL Report
Karsten Farrell <kfarrell_at_belgariad.com> wrote in message news:<MPG.19217f67491f83d898976e_at_news.la.sbcglobal.net>...
> nospam_at_spam.com said...
> > 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
> Kinda hard to do in a single SQL; relatively simple in PL/SQL. In
> sqlplus, type this:
I seem to recall concatenating ascii cr or lf or something, it wasn't
so hard.
But on the other hand, I've worked in so many similar-yet-different
languages I sometimes get confused.
select 'x'|| chr(10)||'y'||chr(10)||'z'
from dual a, dual b
where a.dummy = b.dummy;
If I have to make a particular data format (as opposed to a report format), I usually just massage it in [gn]awk anyways.
jg
-- @home.com is bogus. http://www.signonsandiego.com/news/uniontrib/tue/business/news_1b6briefs.htmlReceived on Tue May 06 2003 - 16:19:08 CDT