Skip to Main Content

Portuguese

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!

Hoteles recomendados en San José, Costa Rica

Ronald Vargas QuesadaJun 15 2015 — edited Jul 1 2015

Aurola Holiday In

Dirección: Calle 5, San José, Costa Rica

Teléfono:+506 2523 1000

https://www.holidayinn.com

Hotel Radisson San Jose Costa Rica

Dirección: San José 5382120, Costa Rica

Teléfono:+506 2257 3257

http://www.radisson.com/san-jose-hotel-cr-494-1007/crsanjos

Gran Hotel Costa Rica

Avenida Segunda entre calles 1 y 3,

San Jose 527-1000, Costa Rica

https://www.granhotelcostarica.com/

Comments

Frank Kulash

Hi,

It's not clear what you want.  It would help if you posted a little sample data (CREATE TABLE and INSERT statements) and the exact results you want from that sample data.

If you want to SUM, or do any kind of aggregate function, on multiple columns, here's one way:

WITH    pivot_data    AS

(

    SELECT  job, sal, comm, deptno

    FROM    scott.emp

)

SELECT    *

FROM      pivot_data

PIVOT     (    SUM (sal)      AS sal

          ,    SUM (comm)     AS comm

          ,    AVG (sal)      AS avgsal

          FOR  job  IN ( 'ANALYST'    AS analyst

                       , 'CLERK'      AS clerk

                       , 'MANAGER'    AS mannager

                       , 'PRESIDENT'  AS president

                       , 'SALESMAN'   AS salesman

                       )

          )

ORDER BY  deptno

;

See the Forum FAQ:

odie_63
Answer

TexasApexDeveloper wrote:

I haven't found any documentation showing how to have multiple columns summed in a pivot query yet.

Not even THE official documentation?

http://docs.oracle.com/cd/E11882_01/server.112/e25554/analysis.htm#DWHSG8731

Marked as Answer by TexasApexDeveloper · Sep 27 2020
TexasApexDeveloper

My bad, I should have done further research.. That looks spot on!!

Thank you,

Tony Miller
LuvMuffin Software
Ruckersville, VA

1 - 3

Post Details

Added on Jun 15 2015
0 comments
390 views