title: How to match records where value is either zero or one and greater
body: <p>I have a MySQL table with an <code>INT</code> column <code>c</code> that has a value of 0 or anything greater.</p>
  
  <p>My <code>SELECT</code> statement contains a variable <code>$x</code> for querying the table that is either 1 or 0. I want to be able to match records where <code>c</code> = 0 if <code>$x</code> is 0, or <code>c</code> >= 1 if <code>$x</code> is 1.</p>
  
  <p>This is how I'm currently doing it in Perl:</p>
  
  <pre><code>my $x; # 1 or 0
  my $c_statement;
  if ($x==0){$c_statement = 'c = 0'}else{$c_statement = 'c &gt;= 1'};
  my $sth = "SELECT * FROM table WHERE $c_statement";
  </code></pre>
  
  <p>Is there a neater way to do this without having to evaluate <code>$x</code> beforehand or using <code>IF</code> clauses in the <code>WHERE</code> statement?</p>