Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Decode Experts - Help

Decode Experts - Help

From: <lakkundi_at_msn.com>
Date: Thu, 05 Nov 1998 03:01:56 GMT
Message-ID: <71r4f4$p18$1@nnrp1.dejanews.com>


A client wants us to list the number of occurrences of holidays celebrated by quarter from

the holiday table. (Holiday table eg. below)

HOLIDAY                   	ACTUALDAT 	CELEBRATE
------------------------- 	--------- 	---------
NEW YEAR DAY              	01-JAN-95 	01-JAN-95
MARTIN KING, JR.   		15-JAN-95 	16-JAN-95
LINCOLNS BIRTHDAY  		12-FEB-95 	20-FEB-95
VALENTINES DAY         		14-FEB-95 	14-FEB-95
MEMORIAL DAY              	30-MAY-95 	29-MAY-95

The output should have column headings that are Q1, Q2, Q3 etc. and look like the following:

Title			Q1	Q2	Q3	Q4      Total
Holiday Occurrence	2	5	2	1	10


Any tips greatly appreciated.

I have tried but it does not well:
sum(decode(to_char(CELEBRATEDDATE, 'Q'),1,NULL)) Q1, sum(decode(to_char(CELEBRATEDDATE, 'Q'),2,1,NULL)) Q2

Thanks&#137;

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Wed Nov 04 1998 - 21:01:56 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US