我只需要在checktime或pin列中获取NULL
值
enter image description here
我的SQL查询
SELECT emp.`emp_id`,cio.`pin`,cio.`checktime` FROM payroll.employees AS emp
LEFT JOIN (SELECT * FROM zkteco_biotime.checkinout WHERE checktime > "2022-09-20 23:59:59") AS cio ON emp.emp_id = cio.pin
WHERE emp.status=0 GROUP BY emp_id ORDER BY checktime DESC
当我在emp.status=0
之后使用AND cio.checktime=NULL
时,结果显示为空白
1条答案
按热度按时间kokeuurv1#
您应该使用
空值与任何值比较都会产生FALSE。只有“IS NULL”和“IS NOT NULL”会传回TRUE。