Py学习  »  DATABASE

MYSQL在id条件为的左连接上不显示结果

MUHAMMAD MESUM • 3 年前 • 1410 次点击  

我有两张桌子,一张叫做附件,用来存储打卡和打卡记录,另一张是日历,我有所有的日期 附件: Attandances

日历: enter image description here

我想获取员工未在我的查询中输入的月份日期,如下所示:

select a.employeeID, c.cdate
from calendar c
    left join attandances a on (c.cdate = a.date)
where a.date is null
and a.employeeID='1'
and c.cdate between '2021-12-01' and '2021-12-31'

但当我执行时,它会返回0行。有什么建议我遗漏了什么吗?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/128988
 
1410 次点击  
文章 [ 3 ]  |  最新文章 3 年前