D
Debbie Davis
Hi there,
SQL 2000
I have the following query:
SELECT sponsor, COUNT(sponsor) * 2 AS total FROM Referrals
GROUP BY sponsor
Works great, returns the sponsor and the total * 2 of their referrals
because that's how much they make per referral. My problem is I need to
pull more information from that table yet still maintain my grouping by
sponsor. Every time I try to add another field, or even * like
SELECT *, sponsor, COUNT(sponsor) * 2 AS total FROM Referrals
GROUP BY sponsor
it wants me to group on all of the fields and I only want to group on
the sponsor. I'm not smart enough to know how to nest these or group
part of it, etc. Hope I'm making sense. Any help is greatly
appreciated. Thanks!
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
SQL 2000
I have the following query:
SELECT sponsor, COUNT(sponsor) * 2 AS total FROM Referrals
GROUP BY sponsor
Works great, returns the sponsor and the total * 2 of their referrals
because that's how much they make per referral. My problem is I need to
pull more information from that table yet still maintain my grouping by
sponsor. Every time I try to add another field, or even * like
SELECT *, sponsor, COUNT(sponsor) * 2 AS total FROM Referrals
GROUP BY sponsor
it wants me to group on all of the fields and I only want to group on
the sponsor. I'm not smart enough to know how to nest these or group
part of it, etc. Hope I'm making sense. Any help is greatly
appreciated. Thanks!
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!