title: SELECT EXISTS in Sybase
body: <p>I have the following query in PostgreSQL (<code>1=1</code> is a placeholder for some arbitrary condition as apparently I can't write <code>WHERE TRUE</code> in Sybase)</p>
  
  <pre><code>SELECT EXISTS FROM (
      SELECT 1 FROM someTable WHERE 1=1  
  )
  </code></pre>
  
  <p>How do I translate them for SQL Server / Sybase syntax ?
  A roundabout way is to do:</p>
  
  <pre><code>SELECT COUNT(*) FROM (
      SELECT 1 FROM someTable WHERE 1=1  
  ) a
  </code></pre>
  
  <p>&hellip; which can further be simplified to:</p>
  
  <pre><code>SELECT COUNT(*) FROM someTable WHERE 1=1  
  </code></pre>
  
  <p>&hellip; but <code>EXISTS</code> is cleaner and I believe it's in the ANSI standard as well. </p>