Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在尝试生成员工何时进出大楼内各个门的数据。数据保存在一个表格中,如 -
理想情况下,我喜欢做datediff几分钟,但我很难让它发挥作用!有人对最好的前进方式有任何想法吗?
datediff
你可以试试这个方法
select uid, serialno, datediff(m, max(time), min(time) ) from tablename group by uid, serialno
分组userId, serialNumber, max(time) and min(time),然后添加一个带有时间差的计算列。
userId, serialNumber, max(time) and min(time)
标签