Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I get sum report as this one?
ilkin.esrefli_at_gmail.com wrote:
> Hello!!
> I want to get result on Oracle as this one:
>
> ------------------
> NAME PRICE
> --------- ------
> book 75.00
> pen 12.35
> notebook 5.05
> <total> 92.4
> ------------------
>
> I know that i may write query as this:
> SELECT name, price FROM tbprices
> UNION
> SELECT 'total', sum(price) FROM tbprices
>
> but it's not good.. I have long query and this method makes long time
> and do one thing two times..
> Is there any short solution about that..?
>
> best Regards...Thanks
Look up BREAK, COMPUTE and SUM in your SQL*Plus documentation.
HTH -g Received on Fri May 12 2006 - 09:10:44 CDT
![]() |
![]() |