SQL 統計每日上班打卡和下班打卡語句
select *_no,*_time as "上班時間",*_time as "上班時間1",*_time as "上班時間2",*_time as "上班時間3",*_time as "下班時間",*_time as "下班時間1",*_time as "下班時間2",*_time as "下班時間3"from (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time) as In_IDfrom attetimewhere doorinout = 1) Twhere *_ID = 1) A1left join (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time) as In_IDfrom attetimewhere doorinout = 1) Twhere *_ID = 2) A2on *_no = *_noleft join (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time) as In_IDfrom attetimewhere doorinout = 1) Twhere *_ID = 3) A3on *_no = *_noleft join (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time) as In_IDfrom attetimewhere doorinout = 1) Twhere *_ID = 4) A4on *_no = *_nofull join (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time desc) as Out_IDfrom attetimewhere doorinout = 0) Twhere *_ID = 1) B1on *_no = *_noleft join (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time desc) as Out_IDfrom attetimewhere doorinout = 0) Twhere *_ID = 2) B2on *_no = *_noleft join (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time desc) as Out_IDfrom attetimewhere doorinout = 0) Twhere *_ID = 3) B3on *_no = *_noleft join (select card_no, atte_timefrom (select card_no,atte_time,ROW_NUMBER() over(partition by card_no order by atte_time desc) as Out_IDfrom attetimewhere doorinout = 0) Twhere *_ID = 4) B4on *_no = *_no投入驗證數據如下:執行結果如下:。
我想通知工人上班打卡怎么
罰款通告 本公司車間員工xxx2010年12月26日在正常上班時間,為滿足個人消極娛樂而隨意怠工,不僅影響其他員工的正常工作,還嚴重影響了公司的生產秩序,觸犯公司的規章制度,給公司生產速度造成不小的影響。
為嚴肅公司工作紀律,加強公司的規章制度,按照公司xx規章制度第xx條xx款規定,給予xxx員工記過警告一次,戀在初犯,xx部門以寬對待,從輕處罰——扣罰當月薪資的3%。以此警告其他員工,工作期間不得怠慢。
如再犯,按照當月薪資的x%,給予嚴厲處罰,并記警告一次,望廣大職工引以為戒。 特此通告 xxxx 公司 xx年x月x日滿意請采納。