Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: tricky SQL

Re: tricky SQL

From: Mark Bole <makbo_at_pacbell.net>
Date: Thu, 03 Mar 2005 17:46:17 GMT
Message-ID: <J3IVd.10991$Pz7.2804@newssvr13.news.prodigy.com>


bcjm wrote:

> I have a table with 3 columns: Person, Class and grade. There are
> unlimited number of classes available but each person can only take 3
> classes max. How do you right one SQL to show the list of class and
> grade of each person in one row?
>
> Example: Table T
>
> p1 c1 A
> p1 c2 D
> p1 c3 B
> p2 c5 B
> p3 C1 A
> p3 C8 C
> ...
> ...
>
> SQL result
> P1 C1 A C2 D C3 B
> P2 C5 B
> P3 C1 A C8 C
>

I'm all in favor of students doing their research, however it's not like the answer just pops right up by following the previous suggestions, as this is not just a simple cross-tab.

Since there are an unlimited number of classes available, is it possible to do this without using an analytic function?

-Mark Bole Received on Thu Mar 03 2005 - 11:46:17 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US