I have a table where each record contains the time, represented by
an hour column (int) and a minute column (int).For example:
**records |hours| mins**
record1 | 15 | 30
record2 | 12 | 25
I want to write a statement where only the records ahead of the current time will be displayed. So far, I have:
SELECT...
WHERE hours >= hour(current_time)
AND
mins >= minute(current_time)
AND...
But this doesn't work because it needs both the hours and mins to be greater than the current hours and minutes. How do I write to that so that if the hours are the same, then the minutes are compared?
Do something like this:
WHERE hours >= hour(current_time)
OR (hours = hour(current_time) AND mins >= minute(currentime))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With