title: SQL how to select multiple rows with the same ID based on criteria of the other columns?
body: <p>I would like to select the rows whose ID meets the criteria in column 2: first Apple then Orange. The desired answer would be the first 2 rows with ID = 1.</p>
  
  <ul>
  <li>ID,Column11,Column12, Column2</li>
  <li>1, 1, 0, Apple</li>
  <li>1, 0, 1, Orange</li>
  <li>2, 1, 0, Apple</li>
  <li>2, 0, 1, Apple</li>
  </ul>
  
  <p>I added two supporting columns Column11 and column12 to label which row for one ID is the first, and which row is the second. Below is my code, but no rows are selected.</p>
  
  <pre><code>SELECT * FROM table WHERE Column11=1 and Column2=’Apple’ AND Column12=1 AND Column2=’Orange’
  </code></pre>
  
  <p>If I only use below, i got row 1</p>
  
  <pre><code>SELECT * FROM table WHERE Column11=1 and Column2=’Apple’
  </code></pre>
  
  <p>If I only use below, I got row 2</p>
  
  <pre><code>SELECT * FROM table WHERE Column12=1 AND Column2=’Orange’
  </code></pre>
  
  <p>Why put them together, I got nothing? Please help. Thanks!</p>