这是我的 MySQL 表:
_______________________________________________
Id | Name| Employee id | Date | Attendance
_______________________________________________
1 | xyz | 196 | 2013-04-01 | present
2 | xyz | 196 | 2013-04-02 | present
3 | xyz | 196 | 2013-04-03 | present
4 | xyz | 196 | 2013-04-04 | absent
5 | xyz | 196 | 2013-04-05 | present
6 | abc | 197 | 2013-04-01 | present
7 | abc | 197 | 2013-04-02 | present
8 | abc | 197 | 2013-04-03 | present
9 | abc | 197 | 2013-04-04 | present
10 | abc | 197 | 2013-04-05 | present
_______________________________________________
我想计算员工最常在场的天数,我想在 PHP 中得到这样的结果:
___________________________________________________________
Name| Employee id| Attendance | Best OR NOT
___________________________________________________________
xyz | 196 | 4 Present days |
abc | 197 | 5 Present days | This is best employees of the year
__________________________________________________________________________
我怎样才能做到这一点?