create table cc(name varchar(30),sbtime datetime,)
insert into cc values('张三','8:30'),('李四','9:20')
SELECT name, CASE WHEN sbtime >'9:00' THEN '旷工' WHEN sbtime between'8:00' and '9:00' then '迟到' end from cc