RE: Problem with GROUP BY

Author: mbsoftwaresolutions@mbsoftwaresolutions.com

Posted: 2016-02-20 at 14:20:54

Jerry -- you've got to list all non-aggregate fields in your GROUP BY.

Example:

SELECT Field1, Field2, Field3, Field4, sum(Field5)

FROM YourTable

GROUP BY Field1, Field2, Field3, Field4

INTO CURSOR Results

hth,

--Mike

On 2016-02-20 14:53, jerry foote wrote:

> I have adjusted the code as below and still get error message GROUP BY

> clause is missing or invalid.

> I am running vp8

>

> SELECT manifest_n, bill_of_la, release_no, frm_acct, source, source_id,

> sum(units) as totat FROM SERVICE WHERE manifest_n=2512 AND

> bill_of_la="158401" GROUP BY release_no INTO CURSOR mytotla

>

>

> -----Original Message-----

> From: ProFox [mailto:profox-bounces@leafe.com] On Behalf Of jerry foote

> Sent: Saturday, February 20, 2016 1:30 PM

> To: 'ProFox Email List'

> Subject: Problem with GROUP BY

>

> When I try to execute the code below i get error message group by error

>

> SELECT manifest_n, bill_of_la, release_no, frm_acct, source, source_id,

> sum(units) as totat FROM SERVICE WHERE manifest_n=2512 AND

> bill_of_la="158401" GROUP BY service.release_no INTO CURSOR mytotla

> ORDER

> BYrelease_no

>

> If anyone can spot the problem I would appreciate a heads up

>

> Thanks Jerry

>

>

>

>

> --- StripMime Report -- processed MIME parts --- multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox

OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/e27d0c92e224a6f4c8815acf69355fd1@mbsoftwaresolutions.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2016 mbsoftwaresolutions@mbsoftwaresolutions.com