Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How can I get sum report as this one?

Re: How can I get sum report as this one?

From: gazzag <gareth_at_jamms.org>
Date: 12 May 2006 07:10:44 -0700
Message-ID: <1147443044.212030.72250@i40g2000cwc.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US