我是一个完整的 MySql 初学者,我希望你能帮助我。我想要一个DTR User Interface
有时间进出的地方。所以我有一个类似的字段 -id_biometrics,empno,datecreated,time_created,status,device
问题是如果员工忘记计时或超时,我想将时间输入或超时设置为“NULL”,这就是我编码的内容。
SELECT start_log.empno AS "Employee Number", start_log.date_created, start_log.time_created AS "Time In", end_log.time_created AS "Time Out"
FROM biometrics AS start_log
INNER JOIN biometrics AS end_log ON start_log.empno = end_log.empno
WHERE start_log.status =0
AND end_log.status =1
AND start_log.empno =2
GROUP BY start_log.date_created, start_log.empno
如果他完成了他一天的时间和时间,我在这里的输出是什么。
Employee Number|date_created |Time_in | Time_Out
2 | 2013-07-15 | 11:08:07 | 15:00:00
如果他/她忘记了 Time Out 或 time in 它显示 MySQL 返回一个空的结果集(即零行)。(查询耗时 0.0016 秒)
我想要的是
Employee Number | date_created |Time_in | Time_Out
3 | 2013-07-15 | 11:50:00 | Null
请帮我解决一下这个。我非常需要它,谢谢。