如何删除秒数并仅显示hh:mm
?
字段类型为time
。例如:
SELECT opentime, closetime FROM hours
Result:
17:00:00 | 23:00:00
17:30:00 | 23:40:00
答案 0 :(得分:13)
SELECT
TIME_FORMAT(opentime, "%H:%i") as opentime,
TIME_FORMAT(closetime, "%H:%i") as closetime
FROM hours;