Vous pouvez utiliser une requête comme celle-ci :
SELECT empID, emp_day, MAX(am_in1) as am_in, MAX(am_out1) as am_out, MAX(pm_in1) as pm_in, MAX(pm_out1) as pm_out
FROM (
SELECT empID, DATE_FORMAT(`time_stamp`,'%e') as emp_day,
CASE WHEN am_pm='am' AND in_out='in' THEN DATE_FORMAT(`time_stamp`,'%T') ELSE '' END as am_in1,
CASE WHEN am_pm='am' AND in_out='out' THEN DATE_FORMAT(`time_stamp`,'%T') ELSE '' END as am_out1,
CASE WHEN am_pm='pm' AND in_out='in' THEN DATE_FORMAT(`time_stamp`,'%T') ELSE '' END as pm_in1,
CASE WHEN am_pm='pm' AND in_out='out' THEN DATE_FORMAT(`time_stamp`,'%T') ELSE '' END as pm_out1
FROM attendance
) as o
GROUP BY empID, emp_day
La sous-requête formate les colonnes souhaitées et les principaux groupes de requêtes pour obtenir une ligne par employé et par jour.
EDIT :voici un violon