Question : Is there a way to provide a range of values to the decode feature of SQL Query?

I have a database that stores the year in the file and I want to count occurences by decade.  Is there a way using SQL Query to provide a range of values to the decode feature?  For example: decode(nd.degree_year_1, 2000 - 2010, '00'. 1990 - 1999, '90', 1980 - 1989, '80').

Answer : Is there a way to provide a range of values to the decode feature of SQL Query?

Oracle
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
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
Random Solutions  
 
programming4us programming4us