请教一个SQL语句,急,多谢 两个表, A: 人员(ID,name) B: 请假 (ID,人员ID,起始时间,结束时间) 我想查找今天没有请假的人员名单,请赐教 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from a inner join b on a.id=b.idwhere not (b.结束时间>=curdate() or 起始时间>=curdate()) orselect * from a inner join b on a.id=b.人员idwhere b.结束时间<curdate() and 起始时间<curdate() orselect * from a inner join b on a.id=b.人员idwhere not (curdate() between b.起始时间 and b.结束时间) select *from 人员where not exists (select 1 from 请假 where 人员ID=人员.ID and curdate between 起始时间 and 结束时间) select * from awhere not exists (select 1 from 请假 where 人员ID=a.ID and curdate() between 起始时间 and 结束时间) select * from 人员 where id not in (select 人员ID from 请假 where day(起始时间)=day(now()); select * from a where begindate>gedate or enddate <gedate left join b where a.id=b.id; A: 人员(ID,name) B: 请假 (ID,人员ID,起始时间,结束时间)===>select from a where not exists(select * from b where a.id=人员id and day(起始时间)=day(now())) 求高手帮看看一个查询语句该怎么写 请教高手:矢量图形如何储存到Mysql数据库中 让大家帮我写一段这种需求的mysql存储过程 请再帮我看一下 sql语句插入多条信息 那种方法好? 远程登录 建表是id的初始值的设置 小弟请教一个与JSP连接问题,请各位高手帮忙,在线等 java 如何对 MySQL 进行访问? 如何在mysql中一次性插入上千条记录 mysql数据库备份文件怎么还原 求,mysql里有类似mssql里的sp_makewebtask吗?
where not (b.结束时间>=curdate() or 起始时间>=curdate())
select * from a inner join b on a.id=b.人员id
where b.结束时间<curdate() and 起始时间<curdate()
select * from a inner join b on a.id=b.人员id
where not (curdate() between b.起始时间 and b.结束时间)
from 人员
where not exists (select 1 from 请假 where 人员ID=人员.ID and curdate between 起始时间 and 结束时间)
where not exists (select 1 from 请假 where 人员ID=a.ID and curdate() between 起始时间 and 结束时间)
select * from 人员 where id not in (select 人员ID from 请假 where day(起始时间)=day(now());
人员(ID,name)
B:
请假 (ID,人员ID,起始时间,结束时间)===>
select
from a
where not exists(select * from b where a.id=人员id and day(起始时间)=day(now()))