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: sql query for horizontal and vertical sum.

Re: sql query for horizontal and vertical sum.

From: Alan <not.me_at_rcn.com>
Date: Sat, 8 Jan 2005 19:36:26 -0500
Message-ID: <34bcp2F47ncknU1@individual.net>

"ashok" <arjdombivli_at_indiatimes.com> wrote in message news:1dc813f.0501080516.7101daa3_at_posting.google.com...
> Dear all,
> I am using the emp like table from the oracle.
> MY requirement is
> 1.
> to calculate the total sum of sal+comm;
> select sal+comm from emp; would only print the results where comm in
> not NULL but I want to display the sal + comm for NULL comm values as
> well (i.e only sal will be displayed for sal + comm ) along with the
> other sal + comm values.
>
> 2.
> alongwith the above requirement , i want the total of only all the sal
> fields (total sal)and total of all the comm fields(total comm).i.e
> vertical total of sal and comm fields.
>
> I have just avergae knowledge of oracle and tried my best to write the
> above related queries but couldn't got the appropriate results.
>
> I request you to kindly help me as I am totally stuck now..
>
>
> regds,
> arj

Dear Student,

In addition to the other suggestions, you may want to look at SQL*PLUS commands, which are not the same as SQL commands. Also, in the future, post what you've tried so far (if you really have tried anything). You may be very close and not realize it. Received on Sat Jan 08 2005 - 18:36:26 CST

Original text of this message

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