|
select a.custno, avg(count(b.*))
from master a left join transactions b on (a.custn=b.custno)
group by a.custno
order by a.custno
Just in the save vein as the original suggestion..
Loyd
-----Original Message-----
From: rob@dekko.com [mailto:rob@dekko.com]
Sent: Friday, September 21, 2001 7:42 AM
To: midrange-l@midrange.com
Subject: RE: Elementary SQL question
And what about the customers with no transactions?
Rob Berendt
==================
A smart person learns from their mistakes,
but a wise person learns from OTHER peoples mistakes.
"Rolf Mittag"
<rm@r-m-e-d-v.de> To:
<midrange-l@midrange.com>
Sent by: cc:
midrange-l-admin@mi Fax to:
drange.com Subject: RE: Elementary
SQL question
09/21/2001 02:20 AM
Please respond to
midrange-l
out of my mind, not tested as I have no such files at hand
select <CustomerNumber>, avg(count(*)) from <transactionFile>
group by <CustomerNumber>
order by <CustomerNumber>
replace names within <> with the correct ones
hth Rolf
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.