Re: Group by error!!!
Date: 1 Sep 2004 21:02:20 -0700
Message-ID: <830861d2.0409012002.436d748d_at_posting.google.com>
I suggest you add an inline view -
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 -
(
SELECT p.pub_nm, b.ean_no FROM publisher p, book b
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
ELSE 'n/a'
You do not need a GROUP BY p.pub_nm here. Received on Thu Sep 02 2004 - 06:02:20 CEST