title: Selecting two rows in a single sql statement only if both conditions are met
body: <p>I've got a table with the following data. </p>
  
  <blockquote>
    <p>table name: myTable</p>
  </blockquote>
  
  <pre><code>prodID   catNo   variable1  variable2
  1        20      Cat        Blue
  2        10      Cat        Red
  2        15      Cat        Green
  2        20      Cat        Black
  3        20      Cat        Yellow
  4        10      Cat        Orange
  4        15      Cat        Brown
  4        20      Cat        Black
  5        30      Cat        Pink
  </code></pre>
  
  <p>I want to be able to select all columns from myTable where the following is true<br/> "(<strong>prodID = 2</strong> and <strong>catNo = 10</strong>) AND (<strong>prodID = 2</strong> and <strong>catNo = 15</strong>)". Therefore getting a result of the two rows only if both conditions are met and it will return nothing if both rows aren't present.
  So my results table will look like this.</p>
  
  <blockquote>
    <p>table name: results</p>
  </blockquote>
  
  <pre><code>prodID   catNo   variable1  variable2
  2        10      Cat        Red
  2        15      Cat        Green
  </code></pre>
  
  <p>I've tried to use conditional if statements but can't seem to get them working in the sql. My current solution it to get back all rows with prodID = 2 and then using php to do the if statement to decide what to display but this won't work with the pagination I've designed for displaying the results as my limit will distort the number of results per page.
  I know I could use 'having count rows=2' but I'm not sure how to word it.</p>