title: How to translate "Any()" and "All()" to DB2 SQL query?
body: <p>I am a newbie in DB2 world and am using:
  - DB2 Data Provider for .NET (IBM.Data.DB2.dll version 9.7.4.4)
  - C# VS2010 with .NET Framework 4.0</p>
  
  <ol>
  <li>I am trying to translate following C# query statement:</li>
  </ol>
  
  <blockquote>
  <pre><code>TestQuery(() =&gt; db.Customers.Any());
  </code></pre>
  </blockquote>
  
  <p>to (DB2) SQL query:</p>
  
  <pre><code>  SELECT CASE WHEN (EXISTS(
    SELECT NULL 
    FROM "CUSTOMERS" t0
    )) THEN 1 ELSE 0 END AS "value"
  </code></pre>
  
  <p>The query above works on <strong>MS SQL troublefree</strong>. But <strong>DB2 doesn't accept that query</strong> and raises ERROR [42601] [IBM][DB2/NT64] SQL0104N</p>
  
  <ol>
  <li>I get also same issue for "All()"</li>
  </ol>
  
  <blockquote>
  <pre><code>TestQuery(() =&gt; db.Customers.All(c =&gt; c.ContactName.StartsWith("a")));
  </code></pre>
  </blockquote>
  
  <p>(DB2) SQL query:</p>
  
  <pre><code>  SELECT CASE WHEN (NOT (EXISTS(
    SELECT NULL 
    FROM "CUSTOMERS" t0
    WHERE NOT ((t0."CONTACTNAME" LIKE :p0 || '%'))
    ))) THEN 1 ELSE 0 END AS "value"
  </code></pre>
  
  <p><strong>My question: How to translate "Any()" and "All()" to DB2 SQL query correctly?</strong><br>
  Any help and hints are highly appreciated. Thx in advance.</p>