title: Is it possible to use "WHERE" clause to select all records in SQL Statement?
body: <p>Good Evening, I am curious if it is possible to make a WHERE-clause in a SQL statement which can show all records? </p>
  
  <p>Below some explanation:</p>
  
  <blockquote>
    <p>Random SQL Statement (<strong>Java</strong>)-(<strong>JSP example</strong>), Normal Situation</p>
  </blockquote>
  
  <pre><code>String SqlStatement = "SELECT * FROM table_example WHERE First_Col = '&lt;%=passVar%&gt;' ";
  db.query(SqlStatement );
  //........
  //........
  </code></pre>
  
  <p>What if the <strong>passVar</strong> is 'ALL', and we need to prompt all the records out when <strong>passVar</strong> = All? I know I can do it with if-else and check if the <strong>passVar</strong> is "ALL" then query the <strong>without-WHERE statement</strong> to make it work..</p>
  
  <blockquote>
  <pre><code>**without-WHERE statement (Java)-(JSP example)**
  </code></pre>
  </blockquote>
  
  <pre><code>if(&lt;%=passVar%&gt; == "ALL") {
     SqlStatement = "SELECT * FROM table_example";
  } else {
  
     SqlStatement = "SELECT * FROM table_example WHERE First_Col = '&lt;%=passVar%&gt;' ";
  }
  </code></pre>
  
  <p>but can I just code one SQL statement to make all the records prompt? Something like below:</p>
  
  <blockquote>
    <p>(<strong>Java</strong>)-(<strong>JSP example</strong>)</p>
  </blockquote>
  
  <pre><code>String ShowAll = "";
  if(&lt;%=passVar%&gt; == "ALL") {
      ShowAll = *;
  
  } else {
      ShowAll = &lt;%=passVar%&gt;;
  }
  SqlStatement = "SELECT * FROM table_example WHERE First_Col = ShowAll ";
  </code></pre>