Re: How do I..... (PL/SQL ?) newbie question.
Date: 1996/08/12
Message-ID: <4unrs5$dtr_at_zeus.mobile.com>#1/1
Why not
SELECT cust#, SUM(gross_revenue)
FROM sales_data
GROUP BY cust#;
Or have I missed an additional complexity which required some extra work?
Hope this helps
Matt
mmarrow_at_pacbell.mobile.com
Steven Kell (skell_at_binc.net) wrote:
: I have a base table for sales data that has fields for cust#, cust_location#,
: (some customers have multiple locations, but the same cust# for all
: locations) quarter, year, and gross_revenue. So, a row looks like this:
: CUST# CUST_LOCATION# QTR YEAR GROSS_REVENUE
: 1 1 1 1995 3500
: 1 2 1 1995 450
: 2 1 1 1995 5600
: 2 1 2 1994 4400
: 1 1 3 1994 42000
: etc.....
: How can I find the total gross revenue for each cust#, regardless of what
: the cust_location#, qtr or year are? I want a sum total of gross_rev for
: cust# 1, cust# 2 for all quarters in all years.
: Any suggestions would be appreciated.
: P.S. I'm using Oracle Workgroup Server V 7.1.3.3.1 on Novell Netware.
: Thanks!!
Received on Mon Aug 12 1996 - 00:00:00 CEST