写个超级简单的上班签到迟到旷工

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

posted @ 2017-04-14 11:07  Chasel-Chen  阅读(198)  评论(0编辑  收藏  举报