DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: Query

Threaded View

  1. #4
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width