Chapter 8 SQL Functions
359
SELECT QUARTER ( ’1987/05/02’ )
The quarters are as follows:
Quarter Period (inclusive)
1 January 1 to March 31
2 April 1 to June 30
3 July 1 to September 30
4 October 1 to December 31
♦ SQL/92 Vendor extension.
♦
Sybase Not supported by Adaptive Server Enterprise.
RADIANS function [Numeric]
Converts a number from degrees to radians.
RADIANS (
numeric-expression
)
numeric-expression A number, in degrees. This angle is converted to
radians.
The following statement returns a value of approximately 0.5236.
SELECT RADIANS( 30 )
♦ SQL/92 Vendor extension.
♦
Sybase Compatible with Adaptive Server Enterprise.
RAND function [Numeric]
Returns a random number in the interval 0 to 1, with an optional seed.
RAND ( [
integer-expression
] )
integer expression The optional seed used to create a random number.
This argument allows you to create repeatable random number sequences.
The following statement returns a value of approximately 0.0554504.
SELECT RAND( 4 )
♦ SQL/92 Vendor extension.
♦
Sybase Compatible with Adaptive Server Enterprise.
Usage
Standards and
compatibility
Function
Syntax
Parameters
Examples
Standards and
compatibility
Function
Syntax
Parameters
Examples
Standards and
compatibility