The rather simple solution is to use the DISTINCT keyword. The original SQL can be replaced with:
Quote:
CREATE TABLE summaryevents (Event CHAR(20), NrPlayers SMALLINT, NrGames SMALLINT, EventDate CHAR(10), Qevent CHAR(30))
INSERT INTO summaryevents (Event, NrPlayers, NrGames, EventDate, Qevent) Select Event, Count(DISTINCT White) as NrP, count() as NrGames, EventDate, Event||Eventdate As Qevent from Gamestable group by Qevent
|
Useful to know, and about 100 times faster!
James