Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Group Sum

Status
Not open for further replies.

GeneCampbell

IS-IT--Management
Jun 12, 2002
6
US
I've taken a look at Volume 5, Chapter 7 and I believe I've come across a syntax problem in the manual.

on page 7-51, Example 2:Group Sum
The query is coded as such:
select city, kind, sales
SUM(sales) OVER (ROWS UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING)
FROM monthly;

When I attempt to apply this example to my table, I get the error message "3707: syntax error: expected something like ')' between the word 'PRECEDING' and the 'and' keyword".

below is the SQL statement I am attempting to execute via QUERYMAN:

select xref_provider_id, claim_count, sum (claim_count)
over (rows unbounded preceding and unbounded following)
from core_workdb.form_xref_merge;

Any help clearing up this problem will be appreciated.
Thanks in advance.
 
I'm not sure which release you are on or which manual you are looking at, but in my Vol 5 (V2r4.1), the SUM operator is on page 7-55. I think you are missing the word BETWEEN after the word ROWS and before UNBOUNDED. So it should be coded as:

select xref_provider_id, claim_count, sum(claim_count)
over (rows BETWEEN unbounded preceding and unbounded following)
from core_workdb.form_xref_merge;

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top