MySQL get a random value between two values

前端 未结 5 1244
日久生厌
日久生厌 2020-12-03 01:01

I have two columns in a row: min_value, max_value. Is there a way to do a select like:

SELECT RAND(`min_v`, `max_v`) `foo` [..]
         


        
5条回答
  •  佛祖请我去吃肉
    2020-12-03 01:26

    Could you do something like this?

    SELECT id, (FLOOR( 1 + RAND( ) *60 )) AS timer
    FROM users
    LIMIT 0 , 30
    

    See this post

提交回复
热议问题