- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我得到了:
id empid Ftime Stime 这是字段。
1 01 2017-03-04 07:00:00 2017-03-04 23:45:00
2 01 2017-03-05 05:14:12 2017-03-05 21:49:03
3 01 2017-03-06 06:08:16 2017-03-06 22:58:13
4 01 2017-03-07 04:12:19 2017-03-07 23:35:20
5 01 2017-03-08 06:17:17 2017-03-08 23:48:19
6 02 2017-03-04 06:40:11 2017-03-04 22:45:00
7 02 2017-03-05 05:19:23 2017-03-05 22:49:03
8 02 2017-03-06 07:08:58 2017-03-06 23:58:13
9 02 2017-03-07 03:12:19 2017-03-07 22:35:20
10 02 2017-03-08 07:19:12 2017-03-08 23:48:19
如果总计 = 54 小时,那么我需要 4 用于 empid 01 等等;
我需要的结果是这样的
empid total hours
01 10
02 20
类似的东西。
提前致谢。
最佳答案
试试这个我包括分钟:
select empid,sum(hours)-50,(sum(mins)/60 + sum(sec)/60) mins from
(select empid, TIMEDIFF(stime,ftime),
SUBSTRING(TIMEDIFF(stime,ftime) FROM 1 FOR 2) as hours,
SUBSTRING(TIMEDIFF(stime,ftime) FROM 4 FOR 2) as mins,
SUBSTRING(TIMEDIFF(stime,ftime) FROM 7 FOR 2) as sec
from yourtable) as a group by empid
关于mysql - 如何根据每个empid获取时间差,得到exists total 50,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42663499/
我对 EPOCH 时间有疑问。 我需要计算两个数据包之间的时间差。我不太确定如何: printf("Epoch Time: %d:%d seconds\n", header->ts.tv_sec, h
我正在尝试了解数字旋转的速度。我有一个程序,其中计数器从 0 开始。 每次用户单击按钮“加 1”。它将计数器递增 1。 计数器最大值为 255。在 255 之后它回到 0。 现在我想显示从 0 到递增
基本上我想做的是根据 SIP 信令获取通话持续时间。 我有一个包含如下所示记录的表,我正在尝试编写一个返回以下内容的 SELECT 语句: id callid date
您好,我需要有关 MySQL 数据库查询的帮助。 我有一个看起来像这样的表: ID TRACKID DATE Name Action 38
细节。我有包含以下列的注释表。 ID - INT(3) Date - DateTime Note - VARCHAR(100) Tile - Varchar(100
午夜过后我很难计算时间: String time = "15:00-18:05"; //Calculating OK //String time = "22:00-01:05"; //Not
我使用 XML 从 MySQL 数据库中抓取了两个日期,如下所示。我想获得以秒为单位的时差。 我写了这个脚本,但它给出了“NaN” function show(){ var t1 = new Dat
如何在 MYSQL phpMyAdmin 数据库中以 (TIME 00:00:00) 格式更新另一个字段(整列)的时间差 当我在 PHP 中执行此操作时,我不断收到 0:00:00 并且没有结果。其
我的表单中有两个字段,用户可以在其中选择输入时间(开始时间、结束时间),我想在更改这些字段时重新计算另一个字段的值。 我想做的是获取 2 次之间的小时数。因此,例如,如果我的开始时间为 5:30,结束
我想使用 Date 和 Calendar 类计算 java 中两个日期/时间之间的差异。我的格式是“2012-01-24 12:30:00 PM”。 我已经实现了我自己的方法,也用谷歌搜索它以与其他人
MySQL 服务器上的访客数据库如下所示id 是主键整数类型,firstname 和 lastname 是文本类型,访客 id 是整数类型 id firstname lastname
我是一名优秀的程序员,十分优秀!