Re: Tricky SQL question

From: <terencefinn_at_my-dejanews.com>
Date: 1998/11/05
Message-ID: <71sbdo$5d8$1_at_nnrp1.dejanews.com>#1/1


Sorry, I recently migrated from Sybase to Oracle and I'm still thinking in terms of temporary tables. Glad you solved the problem.

In article <3640c275.10946920_at_resunix.sickkids.on.ca>,   joost.ouwerkerk_at_sickkids.on.ca (Joost Ouwerkerk) wrote:
> Thanks to Noah and Petre; you both came up with the same solution,
> which I've implemented with success. I try to avoid having to rely
> on PL/SQL, but am coming around to appreciating the utility of a
> function or procedure to simplify an SQL problem every once in a
> while.
>
> On Wed, 04 Nov 1998 19:30:45 GMT, joost.ouwerkerk_at_sickkids.on.ca
> (Joost Ouwerkerk) wrote:
>
> >Given two tables: people (Person, ID) and attributes (ID, attribute)
> >
> >A person can have any number of attributes:
> >
> >ID Attribute
> >--- ---------
> >123 Man
> >123 Actor
> >123 Consumer
> >
> >How can I get the following output using only SQL (SQL*Plus):
> >
> >Person ID Attributes
> >-------------------------- --- ---------------------------------
> >Joe Jones 123 Man, Actor, Consumer
> >Mary Walsh 234 Woman, Comedian, Writer, Director
> >Jackie Chan 456 Man, Martial Artist
> >Larry Sanders 678 Man, Comedian, Producer
> >
> >The attributes must be on one line and separated by commas. Is this
> >even possible?
> >
> >Joost Ouwerkerk
> >Hospital For Sick Children Foundation
> >Toronto, Canada
>
>

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Nov 05 1998 - 00:00:00 CET

Original text of this message