title: Why would someone use WHERE 1=1 AND <conditions> in a SQL clause?
body: <p>Why would someone use <code>WHERE 1=1 AND &lt;conditions&gt;</code> in a SQL clause (Either SQL obtained through concatenated strings, either view definition)</p>
  
  <p>I've seen somewhere that this would be used to protect against SQL Injection, but it seems very weird.</p>
  
  <p>If there is injection <code>WHERE 1 = 1 AND injected OR 1=1</code> would have the same result as <code>injected OR 1=1</code>.</p>
  
  <p>Later edit: What about the usage in a view definition?</p>
  
  <hr>
  
  <p>Thank you for your answers.</p>
  
  <p>Still,
  I don't understand why would someone use this construction for defining a view, or use it inside a stored procedure.</p>
  
  <p>Take this for example:</p>
  
  <pre><code>CREATE VIEW vTest AS
  SELECT FROM Table WHERE 1=1 AND table.Field=Value
  </code></pre>