daprjo
asked on
pivot table
Dear Experts,
What is pivot table. Why we have to use pivot table to generate required number of rows.
Please explain me what is the use of pivot table.
What is pivot table. Why we have to use pivot table to generate required number of rows.
Please explain me what is the use of pivot table.
1 select sum( case when to_char(josh_date + t500.id -1 ,'Dy') in ('SAT','SUN')
2 then 0 else 1 end) as days from (
3 select max(case when first_name = 'priya' then hire_date end ) as priya_date,
4 max( case when first_name = 'joshua' then hire_date end) as josh_date
5 from employee
6 where first_name in ('priya','joshua') ) x,t500
7* where t500.id <= priya_date - josh_date + 1
SQL> /
where first_name in ('priya','joshua') ) x,t500
Error comes :
Table or view not exist
A pivot table (AKA cross tab) is a type of report or tool that summarises data in rows and columns. It has nothing particular to do with SQL tables or queries. You can use a SQL query to simulate the same kind of result but SQL isn't a report development language so pivot functionality is usually better done using presentation and reporting tools instead of SQL.
ASKER
Dear Expert,
Then how i can use it oracle for someother purpose.
Then how i can use it oracle for someother purpose.
ASKER
Dear Expert,
Then how i can use pivot table in oracle .
Then how i can use pivot table in oracle .
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
As simple an explanation and picture of a pivot table as I know is here on Wikipedia:
http://en.wikipedia.org/wiki/Cross_tab
As how to implement one, Sean has given an example above that is pretty simple.
http://en.wikipedia.org/wiki/Cross_tab
As how to implement one, Sean has given an example above that is pretty simple.