Chess Query Language (CQL) was designed to allow researchers, authors,
and players to search for games, problems, and studies that match specific
themes. You specify the theme you are looking for, and the database to
look for them, in CQL. Then you run this CQL file using cql.exe . This
creates a new PGN file that has all the games matching your theme. CQL
can be downloaded here
CQL specifies a small but powerful set of primitives to define chess themes. CQL can find much more complex themes than any other chess program. Users have searched for themes like stalemates with multiple pins; games in which the same position recurs but with the winning side missing just one piece; Nowotny and Grimshaw themes, games with some number of captures on a single square, games with a certain number of black and white passed pawns, and many more. Questions or comments about CQL should be directed to rbnn@rbnn.com.
An article on CQL can found here from the January 2004 issue of the famous end game journal EG.
An excellent series of articles on using CQL within Chess Assistant 9 can be found here.
Updated: September 30, 2007.