mysql中取随机n条记录

取随机n条记录
mysql: select * from tablename order by rand() limit 10
sqlserver: select top 10 * from tablename order by NEWID()