Teradata RANDOM Number

access_time 2 months ago visibility16 comment 0

RANDOM function in Teradata returns a random integer number for each row of the results table. It is a Teradata extension to the ANSI SQL:2011 standard.

Function syntax

Random(lower_bound, upper_bound)

The limits for lower_bound and upper_bound range from -2147483648 to 2147483647 inclusively and upper_bound must be greater or equal to lower_bound.

Example

SELECT RANDOM(1,1000);

The output will be a random number between 1 and 1000. 

copyright This page is subject to Site terms.
Like this article?
Share on

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts

Want to publish your article on Kontext?

Learn more

Kontext Column

Created for everyone to publish data, programming and cloud related articles.
Follow three steps to create your columns.


Learn more arrow_forward

More from Kontext

local_offer teradata local_offer SQL

visibility 994
thumb_up 1
access_time 12 months ago

This code snippet shows how to convert string to date in Teradata.

local_offer teradata local_offer SQL local_offer teradata-sql-query

visibility 82
thumb_up 0
access_time 2 months ago

XML data type is commonly supported in Teradata. Together with native XML type, a number of XML functions are added to support extracting values from XML, shredding and publishing JSON, etc.  info The following code snippets use string literal to demonstrate the usage of these functions; you ...

local_offer teradata local_offer SQL local_offer teradata-functions

visibility 26
thumb_up 0
access_time 2 months ago

Teradata RPAD function is used to add repeated characters at the end of a string to increase the string to a specified length. It can be used to add trailing space or zeros to a string. RPAD(source_string, length, fill_string) Returns the source_string padded to the right with the characters in ...

About column

Tutorials and information about Teradata.

rss_feed Subscribe RSS