CQL 5.1
Created by Lewis Stiller
; Find double checks, sorted by the number of double checks.
; The comments give a few other examples

cql(input heijden.pgn sort matchcount 1 1000)
flipcolor
 attacks 2 (A k)

;
; To get say attacks from rook and bishop, use:
; flipcolor
;  {attacks (B k)
;   attacks (R k)}
;
; to get doublechecks due to a promotion, insert

;  move previous promote

; just before  the "flipcolor" line

Below you find 7 Doublecheck.cql version 3.2.

First All kinds, 2nd with knight and rook etc.

Just copy the part you need to an .cql file.

Created by Peter Boll.

CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckAll.pgn
(position :flipcolor :variations :attackcount A k 2) ; any doublechecks
)
CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckNR.pgn
(position
:variations
:flipcolor
:and
(
(position :attackcount N k 1)
(position :attackcount R k 1) ; Rook and Knight give a Doublecheck
)
)
)
CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckBR.pgn
(position
:variations
:flipcolor
:and
(
(position :attackcount B k 1)
(position :attackcount R k 1) ; Rook and Bishop give a Doublecheck
)
)
)
CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckQR.pgn
(position
:variations
:flipcolor
:and
(
(position :attackcount Q k 1)
(position :attackcount R k 1) ; Rook and Queen give a Doublecheck
)
)
)
CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckQB.pgn
(position
:variations
:flipcolor
:and
(
(position :attackcount B k 1)
(position :attackcount Q k 1) ; Queen and Bishop give a Doublecheck
)
)
)
CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckBN.pgn
(position
:variations
:flipcolor
:and
(
(position :attackcount B k 1)
(position :attackcount N k 1) ; Knight and Bishop give a Doublecheck
)
)
)
CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckQN.pgn
(position
:variations
:flipcolor
:and
(
(position :attackcount Q k 1)
(position :attackcount N k 1) ; Queen and Knight give a Doublecheck
)
)
)
CQL 3.2
(match
:pgn heijden.pgn
:output DoublecheckPromotion.pgn
(position
:variations
:flipcolor
:sequence
((position :movefrom P?7 :moveto ??8) ; Last move is a promotion
; (position :attackcount A k 2) ; any promotion a doublecheck.

(position
:and
(
(position :attackcount Q k 1)
(position :attackcount N k 1) ; Queen and Knight give a Promotion Doublecheck
) ; end and
)
) ; end sequence
)
)

 Many examples can be found in the Harold van der Heijden V database 2015.

Here a few Promotion examples: