SELECT
CASE WHEN nd.degree_year_1 between 2000 and 2010 then '10'
WHEN nd.degree_year_1 between 1990 AND 1999 then '90'
WHEN nd.degree_year_1 between 1980 AND 1989 then '80' END AS Decade,
COUNT(DISTINCT nd.id_number),
TO_CHAR(SUM(g.gift_associated_credit_amt), '$999,999,999.99')
FROM
nau_degrees nd,
gift g
WHERE g.gift_donor_id = nd.id_number
AND g.gift_associated_code = 'P'
AND TRUNC(g.gift_receipt_date) BETWEEN TO_DATE('07/01/2009', 'MM/DD/YYYY') AND TO_DATE('06/30/2010', 'MM/DD/YYYY')
GROUP BY
CASE WHEN nd.degree_year_1 between 2000 and 2010 then '10'
WHEN nd.degree_year_1 between 1990 AND 1999 then '90'
WHEN nd.degree_year_1 between 1980 AND 1989 then '80' END
ORDER BY
1
|