select distinct tp.[order],tp.Module,
(case tpt.Name when 'Color' then Value else '' end) Color,
(case tpt.Name when 'Total' then Value else '' end) Total,
(case tpt.Name when 'DeliveryDate' then Value else '' end) DeliveryDate
from UserDataModel.T_LeanLinePlan tp left join
UserDataModel.T_LeanLinePlanAttribute tpt
on tp.LeanLinePlanId=tpt.LeanLinePlanIdvalue值为‘’,所有数据集出现很多空白的
解决方案 »
- SQLServer08Express版R2版 SQLServer08Developer版R2版之间数据库转换
- 求一触发器写法,(超简单的)大家写啊,引用就送全分.
- 请问怎么向临时表中插入原表中其余的数据,此处假设临时表中的数据不知。谢谢
- sql中出现了“出现了非布尔类型的表达式”,有图,求解!
- 从sqlserver2000数据表中导出数据生成文本文件,对于不同的数据表,在生成文本文件时使用哪种数据结构可使代码具有通用性?
- 在表中,如何得到不在当前年月的所有记录?
- 怎么取大于或等于一个数的最小整数?
- 怎样调用远程服务器上某个表的一个字段
- Sql中如何判断字段是否存在(不是问有没有记录)
- 如何建TRIGGER?
- 请问可以查询表的操作日志吗?请教好心的大虾
- 一个关于sql 语句的简单问题
select tp.[order],tp.Module,
Max(case tpt.Name when 'Color' then Value else '' end) Color,
Max(case tpt.Name when 'Total' then Value else '' end) Total,
Max(case tpt.Name when 'DeliveryDate' then Value else '' end) DeliveryDate
from UserDataModel.T_LeanLinePlan tp left join
UserDataModel.T_LeanLinePlanAttribute tpt
on tp.LeanLinePlanId=tpt.LeanLinePlanId
Where Name in('Color','Total','DeliveryDate')
Group by tp.[order],tp.Module