I am fetching data using following query :
select * from tbl_words where userID = '3'
This select query will give data as it was entered into the database.
Here I want to assign another column for random numbers. So each row will have a random number in random number column.
How do I achieve this?
RAND() (in MySQL) generates a random number between 0 and 1. Multiply by 10 to get between 1 and 10, multiple by 100 for between 1 and 100… and so on.
Thanks to Null in the comments below, RANDOM() in SQLite generates a random number between negative-silliness and positive-silliness, so there’s no need to multiply by anything for SQLite.
On insert:
On select