select count(xx) from xxx where xxx=xxx?

解决方案 »

  1.   

    我说我的想法是你不是有两张表吗?
    每次insert的时候,比如insert    "3       55      迟到     2005年6月5日"
    然后update 另一个表 判断哪个员工,迟到还是早退,把相应的数值+1
    在存储过程中用事务处理操作一下
      

  2.   

    select count(考勤ID ) from clock where 考勤类型=迟到
    迟到的人数
      

  3.   

    select count(考勤ID ) from clock where 员工ID=55 and 考勤类型=迟到
    55迟到的次数
      

  4.   

    谢谢各位
     我要实现把公司全体员工本月所有的考勤记录全安员工和考勤类型分别显示出来.
    出现员工ID  迟到   早退   加班
      55     2       1      2    ///2,1,2表示次数
      6      1       1      2      select count(考勤ID ) from clock where 员工ID=55 and 考勤类型=迟到
    55迟到的次数 
    这样只能取一个值?
      

  5.   

    select select count(考勤ID) from clock where 员工ID=55 and 考勤类型=迟到 ,
    select count(考勤ID) from clock where 员工ID=55 and 考勤类型=早退,
    select count(考勤ID) from clock where 员工ID=55 and 考勤类型=加班
    from clock