title: sql query for by periods
body: <p>I will have 2 fields in my table, NEXTTIME and ENDTIME, the table name is VISIT.</p>
  
  <p>I will get a value from my page which is 00:05:00 or sth like that. the minimum is 5 minute.</p>
  
  <p>I will have to query from the database based on that value.</p>
  
  <p>I will get the earliest NEXTTIME and that time + 00:05:00.</p>
  
  <p>Let's say the earlist NEXTTIME is 06:44.</p>
  
  <p>My query will be like 06:45, 06:50, and so on..</p>
  
  <p>I will also have another input value which is interval time.</p>
  
  <p>Nvm that. </p>
  
  <p>I just wanna know how to get the query by interval.</p>
  
  <p>The result would be looked like this.
  <img src="https://i.stack.imgur.com/ZWaay.jpg" alt="alt text"></p>
  
  <p>NEXTTIME : ENDTIME</p>
  
  <p>06:55:00 ~ 06:58:00</p>
  
  <p>07:25:00 ~ 07:28:00</p>
  
  <p>07:35:00 ~ 08:52:00</p>
  
  <p>08:38:00 ~ 08:48:00</p>
  
  <p>08:40:00 ~ 08:54:00</p>
  
  <p>08:43:00 ~ 09:36:00</p>
  
  <p>09:12:00 ~ 09:30:00</p>