Created
September 16, 2010 14:51
-
-
Save dnnta/582549 to your computer and use it in GitHub Desktop.
This file contains 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
oracle: select * from table_name order by dbms_random.value | |
#扫描记录时给每条记录生成一个随机值,然后根据这个值进行排序 | |
mssql: select top N * from table_name order by newid() | |
mysql: select * from table_name order by rand() | |
#mysql用随机值更新记录 | |
update articles set views = rand()* 1000 | |
sqlite3: select * from table_name order by random() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment