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 のデモです。