SQLite random

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

SQLite random() function

Description

The random() function returns a pseudo-random integer between -9223372036854775808 and +9223372036854775807.

Syntax

random();

SQLite Version : 3.8.5

Example of SQLite random() function

The following SQLite statement returns a random number between -9223372036854775808 and +9223372036854775807.

  1. SELECT QUOTE('w3re''source');  

Here is the result

random()
-------------------
7567341195520768818
sqlite> select random();
random()
-------------------
6027508660740722831
sqlite> select random();
random()
-------------------
6458468859079381942
sqlite> select random();
random()
--------------------
-3984338583065376643
sqlite> select random();
random()
-------------------
2368003023800147000
sqlite> select random();
random()
-------------------
9218255973820515681