批量更新
来源:互联网 发布:怎么在淘宝上找兼职 编辑:程序博客网 时间:2024/06/09 20:03
update attendance set type=t2.type
from attendance t1
inner join
(
select name,id,time=_time,type=case when time<='08:00' and idd=1 then '上班'
when time>'08:00' and time<='12:00' and idd=1 then '迟到'
when time<'12:00' and idd<>1 then '上班重复刷卡'
when time>='13:00' and time<='17:30' and idd=1 then '早退'
when time>'17:30' and idd=1 then '下班'
when time>'13:00' and idd<>1 then '下班重复刷卡'
when time>='12:00' and time<='13:00' then '乱刷卡' end
from
(
select name,id,_time=time,time=convert(varchar(5),time,8),type,
idd=row_number()over(partition by convert(varchar(10),time,120),name order by time)
from attendance where convert(varchar(5),time,8)<='12:00'
union all
select name,id,_time=time,time=convert(varchar(5),time,8),type,
idd=row_number()over(partition by convert(varchar(10),time,120),name order by time)
from attendance where convert(varchar(5),time,8)>='13:00'
union all
select name,id,_time=time,time=convert(varchar(5),time,8),type,idd=0
from attendance where convert(varchar(5),time,8)>='12:00'
and convert(varchar(5),time,8)<='13:00'
)t
) t2
on t1.id=t2.id and t1.time=t2.time
- 批量更新
- 批量更新
- 批量更新
- 批量更新
- 批量更新
- Mybatis 批量增加,批量更新
- Mybatis 批量插入、批量更新
- mybatis3批量更新 批量插入
- SQLServer批量更新、批量插入
- 批量插入,批量更新动作
- jdbc批量插入、批量删除、批量更新
- JDBC批量插入、批量删除、批量更新
- JDBC批量插入、批量删除、批量更新
- jdbc批量插入、批量删除、批量更新
- jdbc批量插入、批量删除、批量更新
- jdbc批量插入、批量删除、批量更新
- dbc批量插入、批量删除、批量更新
- JDBC批量插入、批量删除、批量更新
- Flash小玩意图案创作:跟随的齿轮和太极
- Linux串口通信程序
- java 面试题
- 百度产品经理探秘:需求把握和正确决策【转载】
- 关于JVM GC
- 批量更新
- 计息方式
- Studying note of GCC-3.4.6 source (42)
- socket的错误码总结(Windows和unix) 收藏
- IoC与AOP
- 检查Windows的本地连接状态方法
- ROW_NUMBER,临时视图
- SourceInsight设置(转载)
- 充分利用早上的时间