简单呀,建表两个:
table1:
id,name
table2:
id,VacaDate例,取某段时间内例如5至10日的休息的人的名字:
select name from table1,table2 where table1.id=table2.id and table2.vacadate>=5 and table2.vacadate<=10
table1:
id,name
table2:
id,VacaDate例,取某段时间内例如5至10日的休息的人的名字:
select name from table1,table2 where table1.id=table2.id and table2.vacadate>=5 and table2.vacadate<=10
id name VacaDate
例,取某段时间内例如5至10日的休息的人的名字:
select name from table where VacaDate>=5 and VacaDate<=10
跟我抬杠?当然是建两个表正确了。
select count(name) as numPerson,vacadate from table1,table2 where table1.id=table2.id and name=需要满足的条件 group by table2.vacadate
然后逐个检查vacadate的日期下numperson的值,等于符合要求的人数,则是共同的休息日。你不会, 并不说明我的方法不行!!!