title: Oracle: True value in WHERE
body: <p>I am building a SQL query inside a function. The functions parameters are my criterias for the WHERE clause. Parameters can be null too.</p>
  
  <pre><code>foo (1,2,3)           =&gt;   SELECT x FROM y WHERE a=1 AND b=2 AND c=3;
  foo (null, 2, null)   =&gt;   SELECT x FROM y WHERE b=2;
  </code></pre>
  
  <p>My approach to do that in code is to add a very first alltime true in the WHERE-clause (e.g. 1=1 or NULL is NULL or 2 > 1)</p>
  
  <p>So I do not need to handle the problem that the 1st WHERE condition is after a "WHERE" and all others are after a "AND".</p>
  
  <pre><code>String sql="SELECT x FROM y WHERE 1=1";
  if (a!=null)
  {
    sql += " AND a="+a;
  }
  </code></pre>
  
  <p>Is there a better term than 1=1 or my other samples to EXPLICITLY have a always true value? TRUE and FALSE is not working.</p>