Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
嗨,我是数据透视表的新手,我希望你能帮助我。我有一个名为 Additional User Info 的表...它更容易显示而不是解释:
资源:
T_Info
(ID No, Field, Value) 1000, Gender, Male 1000, Age, 18 1000, School, MIT
我想要的结果 ID,性别,年龄,学校 1000,男,18 岁,麻省理工学院
这可能不使用游标吗?
SELECT IDNo, MAX(CASE WHEN field = 'Gender' THEN Value END) Gender, MAX(CASE WHEN field = 'Age' THEN Value END) Age, MAX(CASE WHEN field = 'School' THEN Value END) School FROM mytable GROUP BY IDNo