Home » SQL & PL/SQL » SQL & PL/SQL » Compute Sum Compute count (SQL plus)
Compute Sum Compute count [message #312452] Tue, 08 April 2008 22:52 Go to next message
senaubi_me
Messages: 24
Registered: February 2008
Junior Member
Hi,

I need some help, i am using the following script line:
compute sum number of column on breakcolumn

my requirement is i need to display the result of the compute sum first before the compute number. The result i am getting is it always display the result of compute number first. Is there a way to do it?

Sample(current result):
COL A COL B
----- -----
a 1
b 2
***** ----
number 2
sum 3
Re: Compute Sum Compute count [message #312466 is a reply to message #312452] Wed, 09 April 2008 00:11 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
According to the online documentation:

"COMPUTE command functions are always executed in the sequence AVG, COUNT, MINIMUM, MAXIMUM, NUMBER, SUM, STD, VARIANCE, regardless of their order in the COMPUTE command."

So, if you want things in a special order, then you have to use something other than SQL*Plus, like some additional SQL code or PL/SQL or a reporting writing utility.


Re: Compute Sum Compute count [message #312480 is a reply to message #312466] Wed, 09 April 2008 00:43 Go to previous messageGo to next message
senaubi_me
Messages: 24
Registered: February 2008
Junior Member
Hi Barbara,

Is it ok if you can give me a direct link to that documentation where it was stated for reference? That would be very helpful.

Thanks,
Jen
Re: Compute Sum Compute count [message #312492 is a reply to message #312480] Wed, 09 April 2008 00:52 Go to previous messageGo to next message
Barbara Boehmer
Messages: 8636
Registered: November 2002
Location: California, USA
Senior Member
http://download.oracle.com/docs/cd/B28359_01/server.111/b31189/ch12014.htm#SQPUG035
Re: Compute Sum Compute count [message #312495 is a reply to message #312480] Wed, 09 April 2008 01:06 Go to previous message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is in the same documentation that we have pointed you yesterday in one of your other topics.
Please read it and don't ask us to point you to each chapter.

Regards
Michel
Previous Topic: Changing a logon trigger does not work
Next Topic: Execute immediate
Goto Forum:
  


Current Time: Sat Dec 10 06:49:58 CST 2016

Total time taken to generate the page: 0.08237 seconds