title: How to do EXISTS select in ANSI SQL
body: <p>Is there a cross-database (at least SQL Server, Oracle, Postgre, MySQL, SQLite) way of doing what I would do in T-SQL using</p>
  
  <pre><code>SELECT 1 WHERE EXISTS (SELECT * FROM Foo WHERE Bar = 'Quux')
  </code></pre>
  
  <p>It seems that this is not valid ANSI SQL syntax because there is no FROM clause. At present I am using COUNT(*) to do this, but I don't think that's optimal.</p>