23.10.2012 Views

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

Openedge Data Management: SQL Reference - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SUM<br />

Note Each char_expression and the result can contain multi-byte characters. The start_pos<br />

argument specifies the character position, not a byte position. Character comparisons are case<br />

sensitive and are determined by sort weights in the collation table in the database.<br />

SUM<br />

Syntax<br />

SELECT C1, C2, SUFFIX(C1, 6, '.') FROM T1;<br />

C1 C2 SUFFIX(C1,6,.<br />

-- -- -------------<br />

test.pref .<br />

pref.test s<br />

2 records selected<br />

SELECT C1, C2, SUFFIX(C1, 1, C2) FROM T1;<br />

C1 C2 SUFFIX(C1,1,C<br />

-- -- -------------<br />

test.pref . pref<br />

pref.test s t<br />

2 records selected<br />

Compatibility<br />

Progress extension<br />

Returns the sum of the values in a group. The keyword DISTINCT specifies that the duplicate<br />

values are to be eliminated before computing the sum.<br />

SUM ( { [ALL] expression } | { DISTINCT column_ref } )<br />

Example This example illustrates the SUM function:<br />

SELECT SUM (amount)<br />

FROM orders<br />

WHERE order_date = SYSDATE ;<br />

Notes • The argument column_ref or expression can be of any type.<br />

• The result of the function is of the same data type as that of the argument except that the<br />

result is of type INTEGER when the argument is of type SMALLINT or TINYINT.<br />

• The result can have a NULL value.<br />

129

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!