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.
我有一张像
和
我希望将该表转换为
使用TeraData查询
如果您知道值列表,则可以使用条件聚合:
select max(case when name = 'AA' then value end) as aa, max(case when name = 'BB' then value end) as bb, max(case when name = 'CC' then value end) as cc, . . . from t;
如果您不知道值列表,则无法使用简单的 SQL 查询来完成此操作。