Solved

oracle pivot column names with embeddded spaces

Posted on 2011-09-27
2
880 Views
Last Modified: 2012-06-22
I am pivoting an oracle view on a certain column. The values in this column may contain embedded spaces. I can get the column names to pivot ok if I surround them with single quotes, however, they then appear in the result with the quotes! Is there any way to get the pivoted column values/names to appear without the quotes? Assume it would not be possible to change the values in the pivoted column to eliminate the blanks.

I have attached a screen image that shows what I mean. pivot table
0
Comment
Question by:bassman592
2 Comments
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 36710347
for metric in ('PATS' as "PATS", 'PATS Ratio' as "PATS Ratio", 'TRX' as "TRX", 'TRX Ratio' as "TRX Ratio")
0
 

Author Closing Comment

by:bassman592
ID: 36710411
Beautiful! Thank you.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now