Converting columns to rows in Oracle [duplicate]
问题 This question already has answers here : Oracle Combine several columns into one (2 answers) Closed 2 years ago . I have a table with two columns first_name, last_name, with one row as john mathew. I want result as john in one row and mathew in next row. FNAME LNAME ------------- JOHN METHEW Result as Name ----- JOHN METHEW In short want to convert column to rows. 回答1: SELECT name FROM pivot_test UNPIVOT ( name FOR origin IN (fname, lname) ) SQL Fiddle 回答2: SELECT fname FROM tb UNPIVOT (