Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Column-wise display of rowdata using sql

518523Feb 6 2007 — edited Feb 6 2007
Is it possible to print the results of the sql query column wise?
e.g I have a table table1 with 3 columns A, B, C the values in one of the rows are 30, 40, 50 resp.

I want to display the results of the query (where A=30) in the following format
A: 30
B: 40
C: 50

(instead of
A B C
-- -- --
40 40 50
)

I know that the column name could be pulled from the all_tab_columns table. But how to use it in the select query on table1? Is it possible to do this using a single sql query?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 6 2007
Added on Feb 6 2007
4 comments
835 views