Home > Archive > Oracle Databases > August 2005 > SELECTing multiple rows to a single output line









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author SELECTing multiple rows to a single output line
R. P.

2005-08-14, 3:23 am

Anybody knows a way to produce output from a SELECT statement on a
single line, instead of each hit on a separate line?

Here is what I mean: let's say I have a table listing families, one per
row that includes the name of father, mother and the number of children.
Then there would be another table with one row for each child and the
rows would be linked to the first table with a foreign key scheme.

Now I would like to list each family with joining the two tables, with
the name of children listed on the same line as the parents, with --
say -- a comma separating each child's name.

I can't figure out any way to produce SELECT output serially, on a
single line. Some suggested stored procedures but my past experience
with stored procedures was that they often were "unstored" when the DBA
did some maintenance and it was just not as reliable as using dynamic
SQL statements, in this case with Java.

Thanks for any tips you might have,
Rudy



2005-08-16, 8:25 pm


"R. P." <r_pol12gar@hotmail.com> wrote in message
news:0v-dnc7yieg3XmPfRVn-2Q@comcast.com...
| Anybody knows a way to produce output from a SELECT statement on a
| single line, instead of each hit on a separate line?
|
| Here is what I mean: let's say I have a table listing families, one per
| row that includes the name of father, mother and the number of children.
| Then there would be another table with one row for each child and the
| rows would be linked to the first table with a foreign key scheme.
|
| Now I would like to list each family with joining the two tables, with
| the name of children listed on the same line as the parents, with --
| say -- a comma separating each child's name.
|
| I can't figure out any way to produce SELECT output serially, on a
| single line. Some suggested stored procedures but my past experience
| with stored procedures was that they often were "unstored" when the DBA
| did some maintenance and it was just not as reliable as using dynamic
| SQL statements, in this case with Java.

http://builder.com.com/5100-6388_14-5259821.html


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com