91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

按某一列里面同一類橫向顯示數據總數

發布時間:2020-03-04 10:22:50 來源:網絡 閱讀:268 作者:重命名 欄目:關系型數據庫

如下圖,統計某一時間段請假類別為Kj_tx 積休假、Kj_nj年假的天數綜合 并按列顯示

select?
a.AlEmpID as 員工ID,
a.alsdate,
a.aledate,
AlTime=(
case when a.ALSTime=480 and a.ALETime=1050 then 1?
? ? ?when a.ALSTime=480 and a.ALETime=720? then 0.5?
? ? ?when a.ALSTime=840? and a.ALETime=1050 then 0.5?
? ? ?when a.ALSTime=870? and a.ALETime=1050 then 0.5?
? ? ? else 0 end) ,
a.ALFType as 請假類別
from? kq_askleave a?
where a.AlEmpID=734 and a.alsdate>='2018-03-01 00:00:00'

按某一列里面同一類橫向顯示數據總數


select?
aa.員工ID,
max(d.Dept_lname) as 科室,
max(b.Emp_code) as 工號,
max(b.Emp_name) as 姓名,
max(b.Emp_zhiweiname) as 職位,
isnull(sum(case when? aa.請假類別 ='Kj_nj' then aa.AlTime+AlDay end ),0) 年假,
isnull(sum(case when? aa.請假類別 ='Kj_sj' then aa.AlTime+AlDay end ),0) 事假,
isnull(sum(case when? aa.請假類別 ='Kj_bj' then aa.AlTime+AlDay end ),0) 病假,
isnull(sum(case when? aa.請假類別 ='Kj_cj' then aa.AlTime+AlDay end ),0) 產假,
isnull(sum(case when? aa.請假類別 ='Kj_hj' then aa.AlTime+AlDay end ),0) 婚假,
isnull(sum(case when? aa.請假類別 ='Kj_tx' then aa.AlTime+AlDay end ),0) 積休假
from?
(select?
a.AlEmpID as 員工ID,
a.alsdate,
a.aledate,
AlDay=(
case when a.ALSTime=480 and a.ALETime=1050? then datediff(day,a.alsdate,a.aledate)+1?
? ? ?when a.ALSTime=480 and a.ALETime=720? then? datediff(day,a.alsdate,a.aledate)
? ? ?when a.ALSTime=840? and a.ALETime=1050 then datediff(day,a.alsdate,a.aledate)?
? ? ?when a.ALSTime=870? and a.ALETime=1050 then datediff(day,a.alsdate,a.aledate)?
? ? ? else 0 end) ,
AlTime=(
case when a.ALSTime=480 and a.ALETime=1050 then 0?
? ? ?when a.ALSTime=480 and a.ALETime=720? then 0.5?
? ? ?when a.ALSTime=840? and a.ALETime=1050 then 0.5?
? ? ?when a.ALSTime=870? and a.ALETime=1050 then 0.5?
? ? ? else 0 end) ,


a.ALFType as 請假類別
from? kq_askleave a?
where a.AlEmpID=734 and a.alsdate>='2016-11-01 00:00:00' and a.aledate<='2018-05-01 00:00:00') aa
left join employeeview b on aa.員工ID=b.emp_id?
left join kq_altype c on aa.請假類別=c.kqaltcode?
left join emp_department d on b.Dept_code=d.Dept_code
group by? aa.員工ID


按某一列里面同一類橫向顯示數據總數

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

托里县| 额济纳旗| 临清市| 时尚| 星座| 沿河| 保山市| 梅州市| 房产| 都兰县| 时尚| 东莞市| 固原市| 长兴县| 宣城市| 曲阜市| 乌什县| 巨鹿县| 牙克石市| 禹州市| 当阳市| 鲁甸县| 河南省| 连云港市| 贵港市| 荣昌县| 淳化县| 墨竹工卡县| 临清市| 黄浦区| 波密县| 衡阳市| 德兴市| 晋州市| 长宁县| 罗定市| 潞城市| 竹溪县| 晋宁县| 绩溪县| 上栗县|