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

Home -> Community -> Usenet -> c.d.o.server -> Re: Totals for very few columns

Re: Totals for very few columns

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 14 Dec 1999 16:06:14 -0500
Message-ID: <j9cd5skh5m6fm9ukbdj9ds1jh7cpflflei@4ax.com>


A copy of this was sent to milesr_at_my-deja.com (if that email address didn't require changing) On Tue, 14 Dec 1999 20:39:56 GMT, you wrote:

>Hello, My name is Ronald.
>
> I'm currently running Oracle 8.5
>
> This is an abbreviated report format of my current database:
>
> Cust_id Location Circuits
> 159 FT. Bragg 42
> 159 FT. Bragg 5
> 159 FT. Bragg 1
>
> Now, if they have the same custid I'd like to add the circuits
>together so I'd only see one record per custid and the circuits number
>would represent the total number of circuits for that custid.
>
> For example:
>
> Cust_id Location Circuits
> 159 FT. Bragg 48
>
> Could someone tell me how to accomplish this task in PL/SQL. It would
>be appreciated.
>

just sql:

select cust_id, location, sum(circuts) from T group by cust_id, location;

>Thanks,
>Ronald
>
>
>
>
>
>Sent via Deja.com http://www.deja.com/
>Before you buy.

--
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'... Current article is "Part I of V, Autonomous Transactions" updated June 21'st  

Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation Received on Tue Dec 14 1999 - 15:06:14 CST

Original text of this message

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