select person count(*) as cs from list where date =>date1 and date<=date2 group by person 
select person count(*) as cs from record where date =>date1 and date<=date2 group by person

解决方案 »

  1.   

    SELECT COUNT(LIST.PERSON),COUNT(RECORD.PERSON) FROM LIST JOIN RECORD
    ON LIST.DATE=RECORD.DATE WHERE DATE=DATEDIFF(DD,(日期1),(日期2))
    注:DATEDIFF()是日期间隔函数
      

  2.   

    select a.name,安排次数,实际出勤次数 from 
    (
    select name,count(*) as N'安排次数'from st group by name
    ) a left join (select name,count(*) as N'实际出勤次数' from st group by name) b
    on a.name=b.name
      

  3.   

    數據應該是:list 
    date person
    3-14 王  
    3-14 孙
    3-16 钱  
    3-16 王record 
    date  person
    3-14  王 
    3-14 李
    3-15  肖 
    3-15 孙
    這樣的?
    把數據貼出來啊。