Funky GROUP BY

Balestrieri, John jbalestrieri at ap.org
Wed Oct 11 13:42:33 CDT 2006


Almost there...

SELECT Race.SeatNumber, Race.OfficeID, Candidate.CandidateID AS 'CCID',
Results.CandidateID, Race.RaceCountyID, Results.RaceCountyID,
Race.Meta_State, Sum(Results.VoteCount)

FROM    Results, Candidate, Race

WHERE Results.CandidateID = Candidate.CandidateID AND Race.RaceCountyID =
Results.RaceCountyID AND Race.Meta_State='CA' AND Race.OfficeID = 'H'

GROUP BY Race.SeatNumber, Race.OfficeID, CCID, Results.CandidateID,
Race.RaceCountyID, Results.RaceCountyID, Race.Meta_State, Results.VoteCount

ORDER BY Race.Seatnumber, Results.VoteCount DESC

When I reference the alias CCID in the GROUP BY clause, the error is:

-----
13:37:30: Error: Kernel error: 0x51500
13:37:30: Error: Identifier "CCID" is not found.
-----

So it looks like the alias creation is OK not throwing an error, but the
referencing of it is throwing an error.

John



On 10/11/06 1:33 PM, "Ruslan Zasukhin" <sunshine at public.kherson.ua> wrote:

> Hmm, sounds like a bug.
> Should not be collision because you specify Table name.
> 
> Please try as workaround assign to one of these fields alias:
> 
> SELECT Race.SeatNumber, Race.OfficeID,
>        Candidate.CandidateID AS 'CCID',
>         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>        Results.CandidateID, Race.RaceCountyID,
>        Results.RaceCountyID,
>        Race.Meta_State,
>        Sum(Results.VoteCount)


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