Created
August 15, 2011 15:59
-
-
Save mallain/1147060 to your computer and use it in GitHub Desktop.
SQLite Tips
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Add several columns on a table | |
alter table tfa_data add column TEMP1 float; | |
alter table tfa_data add column TEMP2 float; | |
alter table tfa_data add column TEMP3 float; | |
// Update columns with randoms float (20 to 40) | |
update tfa_data | |
set temp1 = 20 + abs(random() * 0.0000000000000000020) | |
abs function : The abs(X) function returns the absolute value of the numeric argument X | |
random() : The random() function returns a pseudo-random integer between -9223372036854775808 and +9223372036854775807 | |
See SQLite core function web site for more informations : http://www.sqlite.org/lang_corefunc.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment