Funky GROUP BY

Balestrieri, John jbalestrieri at ap.org
Wed Oct 11 12:05:08 CDT 2006


Hello, I have group by clause that's not working as expected when I run it
from Valentina Studio 2.4.3:

SELECT Race.SeatNumber, Race.OfficeID, Race.Meta_State,
Sum(Results.VoteCount)
FROM Results, Race Group BY Race.SeatNumber

The error is:

----
11:55:50: Error: Kernel error: 0x42508
11:55:50: Error: In the SELECT clause you can use only fields listed in the
GROUP BY and aggregative functions.
----

So following the error to correct the 'problem', things work if I provide
all the fields from the select statement, as in the statement below:

SELECT Race.SeatNumber, Race.OfficeID, Race.Meta_State,
Sum(Results.VoteCount)
FROM Results, Race Group BY Race.SeatNumber,
Race.OfficeID, Race.Meta_State, Results.VoteCount


I've used the first select statement before, and variations of it, in other
SQL engines as well as long ago in Valentina 1.x without any problems. Also,
the Valentina doc wiki shows a similar example:

SELECT rep, AVG (amount) FROM orders GROUP BY rep

<http://www.valentina-db.com/dokuwiki/doku.php?id=paradigma:public:en:docume
ntation:vsql:reference:select:clustering_queries&s=group>

Where only one field is referenced in the GROUP BY clause. I've got a HUGE
select statement in my actual code, and repeating every field in the GROUP
BY is very cumbersome. Is there a shortcut? Any help figuring this out would
be appreciated.

Thanks,
John Balestrieri


The information contained in this communication is intended for the use of the designated recipients named above. If the reader of this communication is not the intended recipient, you are hereby notified that you have received this communication in error, and that any review, dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify The Associated Press immediately by telephone at +1-212-621-1898 and delete this email. Thank you.


More information about the Valentina mailing list