【发布时间】:2021-03-28 19:42:41
【问题描述】:
我有一个表,我想在其中将列值显示为选择中的新列。下一张图片展示了我想要的。
我尝试使用“pivot”,但没有成功。是否可以与枢轴功能有关?
我的查询:
select m.tmarti as line, dsmdcp as column, vlmdmn as valuee
from TABLE01 m
--pivot (count(vlmdmn for dsmdcp in ('Cintura', 'Quadril', 'Busto'))
join TABLE02 t on t.tmarti = m.tmarti
where cdarti = 2026397
order by t.seqtam, dsmdcp;
【问题讨论】: