title: Adding condition in where conditionally
body: <p>I can't seem to find a proper solution for this. Here's  the scenario I want to
  add a condition if the parameter is 0. Looks something like</p>
  
  <pre><code>SELECT * FROM TABLE WHERE  name = @name AND 
  //this is the part I dont know but I want something like
  IF(@id = 0)
  {
  //do nothing
  }else{
  id = @id
  }
  </code></pre>