Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by clause error in sql with NO group by clause
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00801354
Message ID:
00801369
Views:
13
>Thanks... but I don't understand. I'm not trying to group at all, I completely
>understand that when I have a group by clause and am trying to group, that I need
>to make sure all fields are listed there, but I'm not attempting to nor do I want
>to group anything here. Why would it force me to have a group by clause? I haven't
>been required to group any other select statement in any of my other code, why is it
>requiring it here?

The simplest form of this is:
USE HOME(2) + "data\customer"
SELECT cust_id, sum(maxordamt) FROM customer
What cust_id are you going to get here? It will be essentially random, having nothing to do with the final sum.

Your code reads, in part:
SELECT ;
(aTmpData.nRein0 + ;
aTmpData.nRein30 + ;
aTmpData.nrein90 + ;
aTmpData.nrein91 + ;
aTmpData.nrein181), ;
SUM(aTmpData.nRein0), ;
SUM(aTmpData.nRein30), ;
SUM(aTmpData.nrein90), ;
SUM(aTmpData.nrein91), ;
SUM(aTmpData.nrein181)
So, what value for nRein0 + nRein30 + nRein90 + nRein91 + nRein181 should it pick here to go with the SUMmed fields?
My blog
My consulting page
My home page

Member of the Trim Your Auto-Quote Campaign!
What's another word for thesaurus?
Previous
Reply
Map
View

Click here to load this message in the networking platform