RAND() in MySQL — How It Works

What the MySQL RAND() function does, with an example.

Published October 21, 2026

RAND() returns a random floating-point number between 0 and 1.

Key points

  • Part of standard SQL functions available in MySQL for working with query results

Example

SELECT RAND();
More SQL articles