随机0~N之间的整数

select cast(floor(rand() * N) as int) 
原文地址:https://www.cnblogs.com/liu-shiliu/p/5556201.html