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

Home -> Community -> Usenet -> c.d.o.tools -> SQL Question - Summing and Grouping

SQL Question - Summing and Grouping

From: <thomasm516_at_my-deja.com>
Date: Thu, 01 Feb 2001 20:54:26 GMT
Message-ID: <95cids$baj$1@nnrp1.deja.com>

I'm new to SQL, but I do have some programming background. I have two questions.

  1. First, a quick one. Does Oracle have a news server that I can get through my newsreader (I'm using this group through Deja)? Barring that, does anyone know if it's possible to connect to the Deja news server with a newsreader, so that I don't need to go through the Deja.com web site?
  2. This is my main question.

I need to create a report that sums the cost savings for hospital patients and groups the cases into dollar ranges. The ranges are

<=$2,000

$2,001 - $4,000
$4,001 - $6,000
$6,001 - $8,000
$8,001 - $10,000

>$10,000

The output should look like:

Cases with $2,000 or less in cost savings Pat4 1824

Cases with $2,001 - $4,000 in cost savings Pat3 3948

Cases with $4,001 - $6,000 in cost savings Pat1 4634
Pat2 5472

I've got my report so that it sums the figures for each patient, but I'm doing that through the report form, which is preventing me from subsequently grouping the cases into the given dollar ranges. Is there a way through SQL to sum the cost savings on each case, then group the cases into the required dollar ranges?

Any help you can offer will be greatly appreciated!

--Tom

Sent via Deja.com
http://www.deja.com/ Received on Thu Feb 01 2001 - 14:54:26 CST

Original text of this message

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