Funky GROUP BY

Balestrieri, John jbalestrieri at ap.org
Wed Oct 11 15:37:56 CDT 2006


Everything executes now, but the returned results are not as expected. The
Sum(Results.VoteCount) column is coming back as 'No_name8'. Also, the rows
are not grouping properly, meaning all the Race.SeatNumber items are not
being aggregated together... Back to the drawing board on this one for me...

SELECT Race.SeatNumber, Race.OfficeID, Candidate.CandidateID AS 'CCID',
Results.CandidateID, Race.RaceCountyID as 'RRID', 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, Candidate.CandidateID,
Results.CandidateID, Race.RaceCountyID, Results.RaceCountyID,
Race.Meta_State

ORDER BY Race.Seatnumber, Results.VoteCount DESC



On 10/11/06 3:07 PM, "Balestrieri, John" <jbalestrieri at ap.org> wrote:

> Excellent! I understand now, thank you.
> 
> John
> 
> 
> On 10/11/06 2:51 PM, "Ivan Smahin" <ivan_smahin at valentina-db.com> wrote:
> 
>> No.
>> 
>> Again - it will work. And this is following SQL-92 standard.
> 
> 
> 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.
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list