SQLite newbie question

JamesC

Member
Licensed User
I am using an SQLite database to store chess game data from a pgn file. I have a table ("Gamestable") in which each record stores data for one game. The data includes "Event", the "Eventdate" and the name of the "White" player. I wish to summarise the table by unique event (that is event||eventdate), giving for each unique event the number of different white players and the number of games.

The way I have managed to do this is by creating two temporary tables to find the number of players for each event. The code looks something like this:


It works, but I'm sure there's a much better and faster way of doing it.

Any suggestions would be appreciated!

Thanks

James
 
Last edited:

JamesC

Member
Licensed User
Problem Solved

The rather simple solution is to use the DISTINCT keyword. The original SQL can be replaced with:


Useful to know, and about 100 times faster! :sign0188:

James
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…