我想选择一些匹配特定小时间隔的行。所以我尝试这样做,但它不起作用
SELECT *
FROM geocoord
WHERE ID = "3574"
AND startTime < TIME_FORMAT("00:00:00","%h %m %s")
AND endTime > TIME_FORMAT("05:00:00","%h %m %s")
我想要做的是选择在上午12点到凌晨5点之间ID为3574的所有行
答案 0 :(得分:1)
你能试试吗
SELECT *
FROM geocoord
WHERE ID="3574"
AND startTime < TIME_FORMAT("00:00:00","%H:%i:%s")
AND endTime > TIME_FORMAT("05:00:00","%H:%i:%s")