我有一张有电话记录的表。详细信息的phone_number和call_time在毫秒中。哪个SQL语句的舍入call_time为最接近的前60位秒?例如:
phone_number | call_time | rounded_time ===================================== 787-468-8965 | 45786 | 60 787-564-8945 | 128907 | 180
谢谢
答案 0 :(得分:4)
CEILING
功能整理到下一分钟。试试这个:
CREATE VIEW yourview AS
SELECT
CEILING(call_time / 60000) * 60,
-- etc...