Home » SQL & PL/SQL » SQL & PL/SQL » Displaying rows as columns and grouping data (11g)
Displaying rows as columns and grouping data [message #674795] Mon, 18 February 2019 02:15 Go to next message
vaibhav15211
Messages: 38
Registered: August 2012
Location: Hyderabad
Member
Hello,

I have a table with the below structure

Col_date....Col_value
--------....----------
08-Oct-18...A
09-Oct-18...B
09-Oct-18...C

What I want as a SQL output is

08-Oct...09-Oct
------...-------
A........B
.........C

Any idea how can this be achieved.

Thanks,
Vaibhav
Re: Displaying rows as columns and grouping data [message #674797 is a reply to message #674795] Mon, 18 February 2019 02:31 Go to previous message
Michel Cadot
Messages: 66469
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Align the columns in result.
Also always post your Oracle version, with 4 decimals, as solution depends on it.

With any SQL or PL/SQL question, please, Post a working Test case: create table (including all constraints) and insert statements along with the result you want with these data then we will be able work with your table and data. Explain with words and sentences the rules that lead to this result.

Search for PIVOT.
Previous Topic: XMLType Column Comparison in Select Query
Next Topic: Executing dynamic sql using forall
Goto Forum:
  


Current Time: Wed Jul 17 19:44:10 CDT 2019