Message-Id: <10541.110562@fatcity.com> From: Chuck Hamilton Date: Tue, 27 Jun 2000 11:12:59 -0700 (PDT) Subject: Re: Merging results --0-424238335-962129579=:11222 Content-Type: text/plain; charset=us-ascii I'm not sure what you mean. If you mean you want to append a | to all rows the answer is simple... select docnum||'|' from ...; If you mean you want a new column for each row returned there is no way to do it in SQL without first knowing the number of rows being converted into columns. I think something like that would best be handled with a spreadsheet. You could probably do it in Unix too by piping the results of the query through awk and/or sed to build in "insert" or "create table as select... from dual" statement. Andreas Jung wrote: Assume a query like "select docnum from ....." returns a lot of rows. I need to concatenate the docnum column of all rows with "|" and store them in a single new row of another table. What is the fastest way to do this ? Andreas -- Author: Andreas Jung INET: ajung@sz-sb.de Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). --------------------------------- Do You Yahoo!? Get Yahoo! Mail - Free email you can access from anywhere! --0-424238335-962129579=:11222 Content-Type: text/html; charset=us-ascii

I'm not sure what you mean. If you mean you want to append a | to all rows the answer is simple...

select docnum||'|' from ...;

If you mean you want a new column for each row returned there is no way to do it in SQL without first knowing the number of rows being converted into columns. I think something like that would best be handled with a spreadsheet. You could probably do it in Unix too by piping the results of the query through awk and/or sed to build in "insert" or "create table as select... from dual" statement.

  Andreas Jung <ajung@sz-sb.de> wrote:

Assume a query like "select docnum from ....." returns
a lot of rows. I need to concatenate the docnum column of
all rows with "|" and store them in a single new row
of another table. What is the fastest way to do this ?

Andreas
--
Author: Andreas Jung
INET: ajung@sz-sb.de

Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).



Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!