mySQL : using BETWEEN in table ?

Posted by Meko on Stack Overflow See other posts from Stack Overflow or by Meko
Published on 2010-03-30T17:35:27Z Indexed on 2010/03/30 17:43 UTC
Read the original article Hit count: 97

Filed under:
|
|

I have a table that includes somestudent group name ,lesson time,day names like Schedule. I am using C# whit MYSql and I want to find which lesson is when user press button from table.

I can find it like entering exact value like in table 08:30 or 10:25 , it finds. But I want to make that getting system time and checking that is it between 08:30 and 10:25 or 10:25 and 12:30 . Then I can sythat it is first lesson or it is second lesson .

I have also table includes Table_Time column has 5 record like 08:20 , 10:25 , 12:20 so on. Could I use like :

select Lesson_Time 
from mydb.clock 
where Lesson_Time between (current time)-30 AND (current time)+30  

Or can I use between operator between two columns ? Like creating Lesson_Time_Start and Lesson_Time_End and compairing current time like Lesson_Start_Time

© Stack Overflow or respective owner

Related posts about mysql

Related posts about c#