Previous Topic Next topic Print topic


Functions In SELECT Clauses

Restriction: This topic applies to Windows environments only.

The XDB Server provides both ANSI standard and special XDB Server functions that can be used in SELECT clause expressions. Functions (mathematical, string, and date) supported by the XDB Server are listed in Functions.

For example, the XCONCAT function (similar to the || operator) can be nested within itself to concatenate two or more string and column values, as shown by the following query:

SELECT XCONCAT(XCONCAT(color, " "), pname)
FROM part

This query produces the following results:

column1
RED NUT
GREEN BOLT
BLUE CAM
RED SCREW
BLUE CAM
RED COG

When a SELECT clause combines aggregate functions (sum, count, avg, etc.) with column names, the query statement must include a GROUP BY clause. (See Other Clauses for more information on the GROUP BY clause.) Additionally, the column-list of the GROUP BY clause must include all column names that appear in the SELECT clause.

Previous Topic Next topic Print topic