title: ANSI Sql query to force return 0 records
body: <p>I'm looking for an ANSI-SQL method to do a Select query without returning any record, but fill a TDataSet's Fields structure.</p>
  
  <p>The method I found is by adding a "where 1=0" in any query, for example:</p>
  
  <pre><code>Select Id, name, province
  from customers
  where 1=0
  </code></pre>
  
  <p>This is a fairly trivial example, it turns a little more complicated when I have to work with queries entered by the user, then parse them, remove the where clause if it already has one, and replace by "1=0".</p>
  
  <p>If the last clause in the user-entered query is the where clause, then there's no problem at all, but what about more complicated queries like this:</p>
  
  <pre><code>select
    c.lastname,
    sum(cs.amount)
  from customersales cs
  join customers c on c.idcustomer=cs.idcustomer
  /* where 1=0 */
  group by c.idcustomer, c.lastname
  </code></pre>
  
  <p>By using the "where 1=0" method, the only way to insert it in the previous example is by having a rather powerful SQL parser (remember the user can enter complex queries, including Subqueries, and all that), who can understand where to include this string.</p>
  
  <p>Does anyone knows a better way to do this? I cannot use "limit 1" because it must be in an ANSI way.</p>