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 -> Got the Solution

Got the Solution

From: Arun Goel <goel_ar1_at_hotmail.com>
Date: Sat, 30 Nov 2002 18:19:35 -0600
Message-ID: <asbkip$pp9e2$1@ID-127607.news.dfncis.de>


Hi All,

One of my freind helped me. I got this solution though it is little lengthy.

SELECT IN_TABLE.A as A , IN_TABLE.B AS B , C AS VAL_C , MAX_C as COUNT FROM
(

       SELECT A, B,  C , Count(C) AS Count_C
       FROM temp
       GROUP BY A, B ,  C

) IN_TABLE ,
(
        SELECT A,B, MAX( Count_C) as MAX_C FROM
        (
                 SELECT A, B,  C , Count(C) AS Count_C
                 FROM temp
                 GROUP BY A, B ,  C
         )GROUP BY A, B

) CONDITION_TABLE
WHERE IN_TABLE.A = CONDITION_TABLE.A
AND IN_TABLE.B = CONDITION_TABLE.B
AND IN_TABLE.Count_C = CONDITION_TABLE.MAX_C

Regards



Arun Goel
http://www.crml.uab.edu/~ag
"Dieter Valicek" <Dieter.Valicek_at_t-online.de> wrote in message news:asbj54$rol$02$1_at_news.t-online.com...
>
> "Dieter Valicek" <Dieter.Valicek_at_t-online.de> schrieb
> > s.th. for SQL-Server
> oh sorry. wrong DB (it's late in Germany).
>
> But I thing the solution from Damjan S. Vujnovic is not bad.
> Otherwise a solution with Oracle-cursers is also possible.
>
> Dieter
>
>
Received on Sat Nov 30 2002 - 18:19:35 CST

Original text of this message

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