title: mysql Select Row by multiple conditions
body: <p>We are working on a way to select 1 row based on multiple conditions.  An example will clarify this.  Below is an example of our data set.</p>
  
  <pre><code>Name        StartDate     EndDate     HoursBegin    HoursEnd     RowID
  Test 1      11/24/2017    8/24/2018   121           1000         1382
  Test 2      11/25/2018    8/24/2020   1001          2500         1383
  Test 3      11/25/2020    8/24/2022   2501          4000         1384
  </code></pre>
  
  <p>I am looking for a query that will take a couple of conditions (Date and Hours) and decide which row the condition fits it. Consider the following 2 examples.</p>
  
  <ol>
  <li>Simplest case: Date: 11/25/2021 and Hours 2600. This should result in the the 3rd row being selected since both conditions are satisfied with the same row.</li>
  <li>2nd case: Date: 11/26/2018 and Hours 2600. This should result in the 3rd row to be selected again.  Our logic goes something like either by hours or date.  For this I could not simple do an OR in my SELECT WHERE statement because the Date condition would be satisfied by the second row and that is not the row we want to bring back.</li>
  </ol>
  
  <p>I have been trying to figure out how to do this for a couple of days now and have a brain freeze from thinking about it.  Any help would be appreciated.</p>