Generates a random integer between a low and a high number. Two inputs may be Integer or Decimal types, functions returning these types, or column references.

randbetween(1,10)

Output: Generates a random Integer value between 1 and 10.

RANDBETWEEN(value1,value2)


ArgumentRequired?Data TypeDescription
value1YInteger or DecimalInteger or Decimal literal, function returning one of these data types, or a column reference for the lower boundary of the range. Range is inclusive of this value.
value2YInteger or DecimalInteger or Decimal literal, function returning one of these data types, or a column reference for the upper boundary of the range. Range is inclusive of this value.

value1, value2

Literals, functions, or column references to Integer or Decimal values that are used as the lower and upper bounds, respectively, for the range.

Usage Notes:

Required?
Data Type
Example Value
YesInteger or Decimal literal, function, or column reference100 

Example - RANDBETWEEN, PI, and TRUNC functions