| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.oracle -> Re: Group by error!!!
pratap_fin_at_rediffmail.com (Pratap) wrote in message news:<830861d2.0408312306.661a50c3_at_posting.google.com>...
> You should put the entire case statment for "Publisher" in the group by.
>
> Pratap
pratap_fin_at_rediffmail.com (Pratap) wrote in message news:<830861d2.0408312306.661a50c3_at_posting.google.com>...
> You should put the entire case statment for "Publisher" in the group by.
>
> Pratap
updated query.. but still doesn't work
i changed the case to a decode.
Select * FROM
(Select to_char(d.sale_dt,'MM') AS Month, to_char(d.sale_dt,'YY')AS
Year,
m.title_txt AS Title,
DECODE (m.merch_type_cd, 'BOOK',( SELECT p.pub_nm FROM publisher p,
book b
WHERE p.pub_id=b.pub_id AND b.ean_no=m.ean_no ),
'n/a') "Publisher",
t.merch_type_desc AS Format,
m.title_txt, t.merch_type_desc,
DECODE ( m.merch_type_cd, 'BOOK',( SELECT p.pub_nm FROM
publisher p,
book b
WHERE p.pub_id=b.pub_id AND b.ean_no=m.ean_no ),'n/a')
ORDER BY SUM(d.sale_qty * m.unit_price_amt) desc
)
![]() |
![]() |