Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Question for SQL Plus
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
![]() |
![]() |