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: Question for SQL Plus

Re: Question for SQL Plus

From: Frans Hovenkamp <Dieze_at_popin.nl>
Date: Mon, 31 May 1999 10:07:44 +0200
Message-ID: <7itfvl$ccp$1@zonnetje.NL.net>

cheers_up_at_hotmail.com heeft geschreven in bericht <7ip9km$dpj$1_at_nnrp1.deja.com>...
>Hi,
>
>Anyone could please help me to solve the following
>problem. Thanks in advance!
>
>Assume, I have following records in a emp table:
>
> emp_id
> ------
> 2
> 4
> 1
> 5
> 6
>How do you write a SQL query to have the following result?
>
> emp_id
> ------
> 2
> 4
> 1
> 5
> 6
> -----
> Total 18
>
>

Or you could use :

 select emp_id from emp_table
 union
 select sum(emp_id) from emp_table;

Frans Received on Mon May 31 1999 - 03:07:44 CDT

Original text of this message

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