Re: Group by error!!!

From: Mark Anthony <mdejesus_at_gmail.com>
Date: 2 Sep 2004 09:08:40 -0700
Message-ID: <c95e8e39.0409020808.e4daef3_at_posting.google.com>


Thx Pratap... i figured it out yesterday and did about the same as you are suggesting.

pratap_fin_at_rediffmail.com (Pratap) wrote in message news:<830861d2.0409012002.436d748d_at_posting.google.com>...
> I suggest you add an inline view -
> (
> SELECT p.pub_nm, b.ean_no FROM publisher p, book b
> WHERE p.pub_id=b.pub_id ) publisher
>
> Then outer join publisher and merchandise
> publisher.ean_no (+) = m.ean_no
>
> And instead of the case statement in the select, simply put -
>
> nvl(publisher.pub_nm, 'n/a') "Publisher",
>
> Then group by nvl(publisher.pub_nm, 'n/a')
>
> Hope this helps. Next time post the table creation scripts also, so
> that the error can be reproduced at my end.
>
> Pratap
>
> PS -
> CASE
> WHEN m.merch_type_cd='BOOK'
> THEN( SELECT p.pub_nm FROM publisher p, book b
> WHERE p.pub_id=b.pub_id AND b.ean_no=m.ean_no AND ROWNUM =1
> GROUP BY p.pub_nm)
> ELSE 'n/a'
>
> You do not need a GROUP BY p.pub_nm here.
Received on Thu Sep 02 2004 - 18:08:40 CEST

Original text of this message