我正在尝试使用Datediff
函数来计算columnA
和columnB
之间的时间差。
SELECT datediff (minute, stime, etime)
from Exceptions2
where stime = [exceptions2].starttime
and etime = [exceptions2].endtime
这会产生错误。请问有人能帮我看看我做错了什么吗?
我正在尝试使用Datediff
函数来计算columnA
和columnB
之间的时间差。
SELECT datediff (minute, stime, etime)
from Exceptions2
where stime = [exceptions2].starttime
and etime = [exceptions2].endtime
这会产生错误。请问有人能帮我看看我做错了什么吗?
试试这样,不确定为什么你写的是 stime = [exceptions2].starttime 和 etime = [exceptions2].endtime
SELECT datediff(minute, starttime, endtime) from Exceptions2
WHERE
子句来过滤结果。不幸的是,它不能用于创建别名。 :) - p.campbell