In MySQL , timestamp è una parola piuttosto confusa.
Se sono lowerlimit e upperlimit sono TIME colonne da 00:00:00 a 23:59:59 :
SELECT String
FROM TableName
WHERE CURTIME() BETWEEN lowerlimit AND upperlimit
OR CURTIME() BETWEEN SUBTIME(upperlimit, '24:00:00') AND lowerlimit
OR SUBTIME(CURTIME(), '24:00:00') BETWEEN SUBTIME(upperlimit, '24:00:00') AND lowerlimit
Questo gestirà correttamente le transizioni di mezzanotte.