As the count(arg) is not fully documented within help, let me add some thoughts 
and examples.

-- Test-Table
SELECT ALL FROM TEST
KNDNR      ARTNR      AMOUNT     
 ---------- ---------- ---------- 
          1          1        100
          1          1        100
          1          2         50
          1          3         20
          2          2         50
          2                     50 
SELECT KNDNR, COUNT(ARTNR), SUM(AMOUNT) FROM TEST GROUP BY KNDNR
-- count(ARTNR) display number of rows containing any ArtNr per KndNr, but not 
empty values
KNDNR    COUNT  SUM 
 ---------- ---------- ---------- 
          1          4        270
          2          1        100
 
SELECT KNDNR, COUNT(DISTINCT ARTNR), SUM(AMOUNT) FROM TEST GROUP BY KNDNR
-- count(DISTINCT ARTNR) display number of unique ArtNr per KndNr, but not 
empty values
KNDNR    COUNT  SUM 
 ---------- ---------- ---------- 
          1          3        270
          2          1        100

Trap of thinking: The distinct argument affects only the specified column, the 
SUM(AMOUNT) is not influenced. 
In case you are interested on summaries with existing ArtNr only, you have to 
solve this in the where-clause.

Regards
Adrian

> -----Ursprüngliche Nachricht-----
> Von: [email protected] [mailto:[email protected]] Im Auftrag von Dr. Fritz
> Luettgens
> Gesendet: Dienstag, 27. Mai 2014 19:35
> An: RBASE-L Mailing List
> Betreff: [RBASE-L] - (COUNT(arg))
> 
> Hi,
> can anybody give me a short tip where to find Info in Docs
> about function template (COUNT(arg)) ?
> - might be I should stop working now :)
> Thank´s
> fritz
> 

--- RBASE-L
=======================3D=======================3
D=
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
=======================3D=======================3
D=
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
=======================3D=======================3
D=
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
=======================3D=======================3
D=
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
=======================3D=======================3
D=


Reply via email to