Alphabetical list of functions
364
SECONDS (
datetime-expression
|
datetime-expression
,
datetime-expression
|
datetime-expression
,
integer-expression
)
datetime-expression A date and time.
integer-expression The number of seconds to be added to the datetime-
expression. If integer-expression is negative, the appropriate number of
minutes are subtracted from the datetime value. If you supply an integer
expression, the datetime-expression must be explicitly cast as a datetime data
type.
$ For information on casting data types, see "CAST function" on
page 318.
The following statement returns the value 3600:
SELECT ( SECONDS( ’1998-07-13 06:07:12’ ) -
SECONDS( ’1998-07-13 05:07:12’ ))
The following statement returns the value 14400, to signify the difference
between the two times:
SELECT SECONDS( ’1999-07-13 06:07:12’,
’1999-07-13 10:07:12’ )
The following statement returns the datetime value 1999-05-12 21:05:12.
SELECT SECONDS( CAST( ’1999-05-12 21:05:07’
AS TIMESTAMP ), 5)
♦ SQL/92 Vendor extension.
♦
Sybase Not supported by Adaptive Server Enterprise.
SIGN function [Numeric]
Returns the sign of a number.
SIGN (
numeric-expression
)
numeric-expression The number for which the sign is to be returned.
The following statement returns the value -1
SELECT SIGN( -550 )
For negative numbers, SIGN returns -1.
For zero, SIGN returns 0.
For positive numbers, SIGN returns 1.
Syntax
Parameters
Examples
Standards and
compatibility
Function
Syntax
Parameters
Examples
Return value