Have you tried an SQL validator?

Something like: http://developer.mimer.com/validator/index.htm


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of James H. H. Lampert
Sent: Monday, April 29, 2013 12:21 PM
To: Midrange Systems Technical Discussion
Subject: Re: Weird SQL error

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

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.