问题描述
朋友们,
我有2张桌子。一个是主键。
ClientbenifitList表有SupportedID,类型
值是1 --->提前
2 ---->孩子
3 ---->健康
4 ---->退休
onther表是
ClientbenifitForEmployee表有EmployeeName,Amount,SupportedID
emp1 1 1000
emp1 2 2000
emp1 3 3000
emp1 4 4000
emp2 1 1000
emp2 2 2000
emp2 3
emp2 4 4000
我的问题是如何显示
支持ID作为列名
输出如
EmployeeName | Advance | Chield |健康| Retrive
emp1 1000 2000 3000 4000
emp2 1000 2000 null 4000
请帮帮我..
比q
hi Friends,
i have 2 tables. one is primary key.
ClientbenifitList table have SupportedID, type
values are 1--->Advance
2---->Child
3---->Health
4---->Retire
onther table is
ClientbenifitForEmployee table have EmployeeName,Amount,SupportedID
emp1 1 1000
emp1 2 2000
emp1 3 3000
emp1 4 4000
emp2 1 1000
emp2 2 2000
emp2 3
emp2 4 4000
my question is how to display the
SupportedID as column name
output like
EmployeeName | Advance |Chield |Health |Retrive
emp1 1000 2000 3000 4000
emp2 1000 2000 null 4000
please help me..
than q
这篇关于如何将行值显示为列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!