[prog] mysql query

Wolf Rising wolfrising at gmail.com
Thu Mar 30 14:51:53 EST 2006


I am trying to run a query which returns how many employees missed less than
3 shifts during the winter season. The query works except it doesn't show
who had perfect attendance. Is there anyway to modify the current
query to include
those individuals who missed zero shifts? An employee's status for the day
may be recorded as absent, late or present.

Thanks for any assistance :-)

select l_name, f_name, attendance.s_code, season.building_code,
count(*) as total from sa.attendance, se.employee,
se.season where attendance.s_code = employee.s_code and
attendance.s_code = season.s_code and employee.s_code = season.s_code and
attendance.season = season.season and attendance.year= season.year and
attendance.status = 'absent' and attendance.season='Winter'
and attendance.year=2006 and season.building_code='MAIN'
group by s_code having count(*) < 4 order  by total asc, l_name;


More information about the Programming mailing list