NightOnDutyPersonnel:晚班人员 打错了。
解决方案 »
- 不显示删除回复显示所有回复显示星级回复显示得分回复 迎国庆,绘国旗(高分)。
- 调用wcf时序列化时出错,***不是所需的类型
- C#能否网络P2P通信
- C#模拟键盘按着不动
- 求助:窗体如何互斥
- 请教:调试运行控制台程序时,DOS窗体中的内容还没有看清,就被自动关闭了,请问怎么取消自动关闭?
- 马上结贴:ajax问题!
- 请问如何获取Datagrid绑定数据后的高度?
- 请问我这个小程序应该选择一个什么样的模板??进来说说,,高手们!!!
- net中有关<INPUT id="a" type="file"runat="server">控件不能使用大于4M文件的问题
- C#做了一个Form,包含Access数据库的软件 打包安装后启动提示数据库路径有问题
- 想用C#做一个GPS车辆监管软件,请教各位有什么适合的GPS硬件和平台?
select 4,'李四','张三','王五' union
select 5,'李四','王五','李四' union
select 6,'张三','李四','王五' union
select 7,'李四','张三','李四' union
select 8,'王五','李四','赵六'
)select Name,
case when MorningCnt is NULL then '0' else MorningCnt end as MorningCnt,
case when NoonCnt is null then '0' else NoonCnt end as NoonCnt,
case when NightCnt is null then '0' else NightCnt end as NightCnt from
(select Morning as Name from tb union
select Noon as Name from tb union
select Night as Name from tb) as BASE
full join (select Morning,count(Morning) as MorningCnt from tb group by Morning ) as MORNING on BASE.Name = MORNING.Morning
full join (select Noon,count(Noon) as NoonCnt from tb group by Noon) as NOON on BASE.Name = NOON.Noon
full join (select Night,count(Night) as NightCnt from tb group by Night) as NIGHT on BASE.Name = NIGHT.Night
Name MorningCnt NoonCnt NightCnt
李四 3 3 2
王五 2 2 4
张三 3 3 1
赵六 0 0 1
with tb(ID,Morning,Noon,Night)as
(
select 1,'张三','李四','王五' union
select 2,'王五','张三','王五' union
select 3,'张三','王五','张三' union
select 4,'李四','张三','王五' union
select 5,'李四','王五','李四' union
select 6,'张三','李四','王五' union
select 7,'李四','张三','李四' union
select 8,'王五','李四','赵六'
)select Name,
case when MorningCnt is NULL then '0' else MorningCnt end as MorningCnt,
case when NoonCnt is null then '0' else NoonCnt end as NoonCnt,
case when NightCnt is null then '0' else NightCnt end as NightCnt from
(select Morning as Name from tb union
select Noon as Name from tb union
select Night as Name from tb) as BASE
full join (select Morning,count(Morning) as MorningCnt from tb group by Morning ) as MORNING on BASE.Name = MORNING.Morning
full join (select Noon,count(Noon) as NoonCnt from tb group by Noon) as NOON on BASE.Name = NOON.Noon
full join (select Night,count(Night) as NightCnt from tb group by Night) as NIGHT on BASE.Name = NIGHT.Night
Name MorningCnt NoonCnt NightCnt
李四 3 3 2
王五 2 2 4
张三 3 3 1
赵六 0 0 1