|
On 4/29/13 12:04 PM, rob@xxxxxxxxx wrote:
I agree with Buck. If you have
select customernumber, customerName, sum(orderDollars) as
TotalOrderDollars
from orderheader
group by customernumber
you will get that error because customerName is not in the group by, nor
is it in any summary functions. Is this why?
It could very well be. The query in question is over 170 lines long, and has multiple constructs of the form
. . .left join (select foo, bar, baz . . . from ham, eggs, spam where . . . group by . . . ) as frobozztable on . . . left join . . .
and with my meager understanding of SQL, I'm having trouble breaking the thing down into individually testable pieces. Unfortunately, there "ACCOUNT_ID" appears 62 different times in the query, both as a field being referenced and as a field being defined in the temporary table declarations (or whatever those constructs are called).
Do I sound frustrated?
Further advice would be appreciated.
--
JHHL
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 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.