select ANAME from A group by datepart(week,ADATE)
having count(*)=7

解决方案 »

  1.   

    select * from A 
    group by datepart(week,ADATE)
    having count(*)>=7
      

  2.   

    select ANAME from (select aname,count(*) aa from A group by aname) a where a.aa>=20
      

  3.   

    select ANAME from (select aname,month(ADATE) bb,count(*) aa from A group by aname,month(ADATE)) a where a.aa>=20
      

  4.   

    to: nchln(打倒传奇) 我要的是一個月內連續工作20天的員工﹐而不是一個月內工作了20天的員工