A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  special characters  sybase-tech-blog


Category: ASE: Functions: Mathematical Functions

rand()

The mathematical function rand() returns a random floating point number between 0 and 1. Declaring a constant as parameter "integer" a random "float number" can be generated, which never changes.

Syntax der Mathematical Function rand()

    rand([integer])
    

The parameter "integer" of the Mathematical Function rand()

integer
The parameter "integer" is an optional placeholder for a number which can be of one of the datatypes tinyint, smallint or int. Additionally the parameter "integer" can be of any other datatype which can be converted into one of the required datatypes using implicit conversion.

Example for the Mathematical Function rand()

    select rand(100)
go
-----
0.595760

Returns always 0.595760.

See also:

ASE T-SQL - Aggregate Functions,
Mathematical Functions,
abs(),
acos(),
asin(),
atan(),
atn2(),
ceiling(),
cos(),
cot(),
degrees(),
exp(),
floor(),
log(),
log10(),
pi(),
power(),
radians(),
round(),
sign(),
sin(),
sqrt(),
tan().