行与列的倒数

行与列的倒数,第1张

行与列的倒数

请尝试UnPIVOT:

SELECt substr(kind,2,1) AS kind,"value" FROM (        SELECt        5 AS l0,        2 AS l1,        3 AS l2,        4 AS l3    FROM dual)temp unpivot include NULLS ("value" FOR kind IN (l0, l1 , l2, l3));

反之:

 SELECt *    FROM  (      SELECt Kind,  max(Value) Value      FROM table       GROUP BY Kind ) PIVOT ( max(Value) FOR Kind IN (L0, L1, L2, L3) );

假设您实际上有一个要查询的表。



欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5508888.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-13
下一篇 2022-12-13

发表评论

登录后才能评论

评论列表(0条)

保存