Home » SQL & PL/SQL » SQL & PL/SQL » How too convert rows into columns based on order hiredate month wise (oracle 12c)
How too convert rows into columns based on order hiredate month wise [message #680138] Fri, 24 April 2020 00:37 Go to next message
narendraenamala
Messages: 7
Registered: November 2016
Junior Member

Hi All,

I have a requirement to show employee data
if table had first row with hiredate "jun" month it starts with jun otherwise whatever month comes it changes the month order

output scenario
---------------
empno deptno jun jul aug sep oct nov dec jan feb mar apr may
1234 10 sum(sal)

Thanks in advance
Re: How too convert rows into columns based on order hiredate month wise [message #680139 is a reply to message #680138] Fri, 24 April 2020 00:57 Go to previous message
Michel Cadot
Messages: 67363
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

From your previous topics:

BlackSwan wrote on Thu, 24 November 2016 16:29
Welcome to this forum

Please read and follow the forum guidelines, to enable us to help you:
OraFAQ Forum Guide
How to use {code} tags and make your code easier to read
...
John Watson wrote on Thu, 24 November 2016 16:30
Welcome to the forum. Please read our OraFAQ Forum Guide and How to use [code] tags and make your code easier to read
...
Michel Cadot wrote on Sat, 01 July 2017 07:44

Welcome to the forum.
Please read OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Also always post your Oracle version, with 4 decimals, as solution depends on it.
...
Michel Cadot wrote on Sat, 01 July 2017 07:45

Also if you want to continue to get help, feedback in your topics.


Please read the OraFAQ Forum Guide and How to use [code] tags and make your code easier to read.
Indent the code, use code tags and align the columns in result.

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: Need age difference between warning and critical
Next Topic: Query
Goto Forum:
  


Current Time: Sun Sep 20 19:13:25 CDT 2020