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.
我想查询表值
Column1 Column2 Column3 ----------------------- a b c d e f
结果应该是
Column1 a Column2 b Column3 c Column1 d Column2 e Column3 f
基本上是一个键值对。甲骨文有可能吗?
我在这里先向您的帮助表示感谢
你可以这样做UNION ALL,像这样:
UNION ALL
SELECT 'Column1' as Name, Column1 as Value FROM my_table UNION ALL SELECT 'Column2' as Name, Column2 as Value FROM my_table UNION ALL SELECT 'Column3' as Name, Column3 as Value FROM my_table
这是关于 sqlfiddle 的演示。