【问题标题】:SQL find out the hours between 2 date time columnSQL找出2个日期时间列之间的小时数
【发布时间】:2013-12-05 07:47:13
【问题描述】:

如果我的时间列中的 2 个在超过 15 小时内有差异,是否可以给出条件。

给定colTime1colTime2 in table

SELECT * FROM table WHERE time between colTime1 and colTime 2 is difference for over 15 hours

【问题讨论】:

标签: mysql sql datetime select


【解决方案1】:

试试这个:确保你的日期格式也包括时间,否则返回天数的差异

DATEDIFF(hour, date1 ,date2);

几天

DATEDIFF(date1 ,date2);

【讨论】:

    猜你喜欢
    • 2021-10-18
    • 1970-01-01
    • 1970-01-01
    • 2020-09-21
    • 2018-04-30
    • 1970-01-01
    • 1970-01-01
    • 2011-01-01
    • 2021-10-21
    相关资源
    最近更新 更多