中文字幕日韩精品一区二区免费_精品一区二区三区国产精品无卡在_国精品无码专区一区二区三区_国产αv三级中文在线

按某一列里面同一類橫向顯示數(shù)據(jù)總數(shù)

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

成都創(chuàng)新互聯(lián)是一家專注于成都網(wǎng)站建設、成都網(wǎng)站設計與策劃設計,阜新網(wǎng)站建設哪家好?成都創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設十年,網(wǎng)設計領域的專業(yè)建站公司;建站業(yè)務涵蓋:阜新等地區(qū)。阜新做網(wǎng)站價格咨詢:13518219792

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'

按某一列里面同一類橫向顯示數(shù)據(jù)總數(shù)

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) 產(chǎn)假,
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

按某一列里面同一類橫向顯示數(shù)據(jù)總數(shù)

當前名稱:按某一列里面同一類橫向顯示數(shù)據(jù)總數(shù)
標題鏈接:http://www.rwnh.cn/article12/psjcgc.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、動態(tài)網(wǎng)站、品牌網(wǎng)站設計外貿(mào)建站、定制開發(fā)、標簽優(yōu)化

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站建設
南郑县| 芦溪县| 澄迈县| 汉川市| 绿春县| 卓资县| 乌兰察布市| 斗六市| 崇左市| 巨野县| 灌云县| 晴隆县| 疏附县| 辰溪县| 行唐县| 饶阳县| 台中市| 名山县| 娱乐| 五原县| 涡阳县| 芜湖县| 茌平县| 怀远县| 宁乡县| 昭平县| 克拉玛依市| 得荣县| 景谷| 通榆县| 鹤壁市| 莱芜市| 平顶山市| 汶上县| 家居| 临沂市| 万山特区| 府谷县| 甘孜县| 洪泽县| 鞍山市|