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

Home -> Community -> Usenet -> c.d.o.server -> Re: What's wrong with this sql query ?

Re: What's wrong with this sql query ?

From: Micha Huybrechts <mrh_at_technologist.com>
Date: Sun, 19 Sep 1999 11:51:09 +0200
Message-ID: <7s4vvv$4ee3u$1@reader3.wxs.nl>


If you want to see the total number of records, you should use COUNT instead of SUM. Also if you break on local, you only get a stat (SUM, COUNT,...) if the value of local changes.

Hope this helps,

M.Huybrechts
Software Engineer

Park Sung-Hye wrote in message <91mF3.905$PD4.55752_at_news2.bora.net>...
>Dear All
>
>I made this sql query for my reporting like this
>But I could not get the sum of cci with this .
>I don't know what's wrong with this ?
>
>Query :
>
> column local heading 'Local '
> column substr(identificcation ,1,1) heading 'type'
> column comp heading 'Company '
> break on local skip 1
> compute sum of comp on local
> select local,substr(identification,1,1),comp,address,tel
> from sometable where substr(identification ,1,1) in ('B','C') order by
>local,substr(identification,1,1)
>
>
>the result which I want to :
>
>Local type Company ADDRESS TEL
> A A aaaaaa bbbbbb 12345678
> B dddddd ffffffffff 98075433
>-----------------------------------------
> sum 2
>
>but when I execute upper sql , I could not get the sum.
>So I ask your help
>Thanks for your help in advance
> Have a good day
>
>
>
>
>
>
>
Received on Sun Sep 19 1999 - 04:51:09 CDT

Original text of this message

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