I don't think DECODE will help with a range of values. Try using CASE, something like:
SELECT . . . .
SUM(CASE WHEN p.courtaction < 50 THEN 1 ELSE 0 END) less,
SUM(CASE WHEN p.courtaction < 50 THEN 0 ELSE 1 END) more,
. . .
with no > or < condition in the WHERE clause.
(I presume you didn't want to exclude the case of EXACTLY 50 courtactions ? ! ?)
Just thought - NULL's might have to be considered . . . . ?
Last edited by DaPi; 02-27-2003 at 04:28 AM.
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman