Answers.Body: <p>All right, so I found the following query for the pawn structure in the diagram above:</p>
  <pre><code>(match  ;query for IQP white 
        (position 
           :and (
              (position Pa2 Pb2 Pd4 Pf2 Pg2 Ph2 pa7 pb7 pe6 pf7 pg7 ph7)
              (position
              :piececount P[c2-7,e2-7] 0
              :piececount p[c2-7,d2-7] 0 )
           )
        )
  )
  </code></pre>
  <p>For black though, I wanted to search for any IQP position, so I used this query:</p>
  <pre><code>    (match ;query for IQP black
        (position
          :and (
            (position pd5)
            (position
              :piececount P[a2-7] 1
              :piececount P[b2-7] 1
              :piececount P[c2-7] 0
              :piececount P[d2-7] 0
              :piececount P[e2-7] 1
              :piececount P[f2-7] 1
              :piececount P[g2-7] 1
              :piececount P[h2-7] 1
  
              :piececount p[a2-7] 1 
              :piececount p[b2-7] 1 
              :piececount p[c2-7] 0 
              :piececount p[d2-7] 1 
              :piececount p[e2-7] 0 
              :piececount p[f2-7] 1 
              :piececount p[g2-7] 1 
              :piececount p[h2-7] 1 
        )
       )
    )
  )
  </code></pre>
  <p>Lame, but at least it works :)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-24T13:49:24.453Z
Answers.Text: I gather that this answer is based on the CQL 3 implementation? Since the latest implementation is 5.2, and ScidVsPC is based off that - I tried to port it over and had some difficulties. Have you tried it in CQL 5.2? The part below is valid in 5.2, but I can't get the piececount to work, so the query is incomplete.
  cql() Pa2 Pb2 Pd4 Pf2 Pg2 Ph2 pa7 pb7 pe6 pf7 pg7 ph7
Answers.UserDisplayName: Joe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-03-07T21:23:24.667Z
Answers.LastActivityDate: 2021-03-07T21:23:24.667Z
Answers.UserDisplayName: Raul Diaz
Body: <p>I'm looking for a CQL query that will return all positions with the below pawn structure for both White and Black</p>
  <pre><code> [FEN &quot;8/pp3ppp/4p3/8/3P4/8/PP3PPP/8 w - - 0 1&quot;]
  </code></pre>
  
Tags: <isolated-pawn><cql>
Title: CQL - Isolated Queen Pawn postions
ThreadText: # CQL - Isolated Queen Pawn postions
  
  (Asked by: username_0 on 2021-03-07)
  
  I'm looking for a CQL query that will return all positions with the below pawn structure for both White and Black
   [FEN "8/pp3ppp/4p3/8/3P4/8/PP3PPP/8 w - - 0 1"]
  
  **Tags:** isolated-pawn, cql
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-03-07. Score: 1
  
  All right, so I found the following query for the pawn structure in the diagram above:
  (match  ;query for IQP white 
        (position 
           :and (
              (position Pa2 Pb2 Pd4 Pf2 Pg2 Ph2 pa7 pb7 pe6 pf7 pg7 ph7)
              (position
              :piececount P[c2-7,e2-7] 0
              :piececount p[c2-7,d2-7] 0 )
           )
        )
  )
  
  For black though, I wanted to search for any IQP position, so I used this query:
      (match ;query for IQP black
        (position
          :and (
            (position pd5)
            (position
              :piececount P[a2-7] 1
              :piececount P[b2-7] 1
              :piececount P[c2-7] 0
              :piececount P[d2-7] 0
              :piececount P[e2-7] 1
              :piececount P[f2-7] 1
              :piececount P[g2-7] 1
              :piececount P[h2-7] 1
  
              :piececount p[a2-7] 1 
              :piececount p[b2-7] 1 
              :piececount p[c2-7] 0 
              :piececount p[d2-7] 1 
              :piececount p[e2-7] 0 
              :piececount p[f2-7] 1 
              :piececount p[g2-7] 1 
              :piececount p[h2-7] 1 
        )
       )
    )
  )
  
  Lame, but at least it works :)
  
  > **Comments:**
  > **username_1**: I gather that this answer is based on the CQL 3 implementation? Since the latest implementation is 5.2, and ScidVsPC is based off that - I tried to port it over and had some difficulties. Have you tried it in CQL 5.2? The part below is valid in 5.2, but I can't get the piececount to work, so the query is incomplete. cql() Pa2 Pb2 Pd4 Pf2 Pg2 Ph2 pa7 pb7 pe6 pf7 pg7 ph7  
  
  ---
  
  