NexusDB Manual V3 > SQL Reference > SQL Functions > Numeric Value Functions
Syntax
<extract expression> ::=
<extract field> ::= <primary datetime field>
<extract source> ::= <datetime value expression>
Notes
Examples
1) The following example extracts the YEAR, MONTH and DAY fields from the orderDate column:
SELECT orderID, EXTRACT( YEAR FROM orderDate ) AS "Year", EXTRACT( MONTH from orderDate ) AS "Month", EXTRACT( DAY FROM orderDate ) AS "Day", orderTotal FROM orders
2) The following example groups order totals by year:
SELECT "Year", SUM( orderTotal ) AS "Total Amount" FROM ( SELECT EXTRACT( YEAR FROM orderDate ) AS "Year", orderTotal FROM orders ) AS orders GROUP BY "Year"
Conformance
|
© Nexus Database Systems Pty Ltd.