insert a random number into each row in table

前端 未结 2 1849
误落风尘
误落风尘 2021-01-15 05:26

I currently have an oracle table (lovalarm) containing around 600,000 rows. I need to be able to run a query which will cycle through each row and update a field (lovsiteid

2条回答
  •  抹茶落季
    2021-01-15 05:57

    Try this:

    update lovalarm set lovsiteid = (select FLOOR(RAND() * (17300 - 14300) + 14300))
    

    works in MySQL

提交回复
热议问题