DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Decode or translate with rollup

Threaded View

  1. #2
    Join Date
    May 2005
    Posts
    31
    how about query like this ?

    select Writer, decode(groupid,1,cntname,null), summ from (SELECT nvl((a.name),'Total:') AS Writer count(DISTINCT a.name) cntname, count(b.isbn) AS Summ, grouping (a.name) groupid
    FROM author a, book b
    WHERE a.id = b.author_id
    GROUP BY ROLLUP(a.name))

    /
    Last edited by Bonker; 07-06-2005 at 01:01 AM.
    Experience is a hard teacher because she gives the test first, the lesson afterwards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width