y: select userid, name, checktime, campaign,  CASE WHEN Hoursworked - 0 > 0 THEN Hoursworked - 0 ELSE 0 END Overtime from (      select       a.userid,a.name,a.campaign,      date(a.CHECKTIME),     timediff(max(b.CHECKTIME), min(a.CHECKTIME)) as Hoursworked     from 