title: Time range- Sql
body: <p>please help me with my problem. So, I have a table named 'RATES' which contains these columns:</p>
  
  <pre><code>id (int) 
  rate (money) 
  start_time (datetime) 
  end_time(datetime)
  </code></pre>
  
  <p>example data: </p>
  
  <pre><code>1 150 8:00am 6:00pm 
  2 200 6:00pm 4:00am
  3 250 8:00am 4:00am (the next day)
  </code></pre>
  
  <p>What I have to do is to select all the id(s) to where a given time would fall.</p>
  
  <p>e.g given time: 9:00 pm, the output should be 2,3</p>
  
  <p>The problem is I got this time range between 8am to 4am the next day and I don't know what to do. Help, please! thanks in advance :D</p>