开发者

simple field update mysql

开发者 https://www.devze.com 2023-04-09 12:00 出处:网络
I have a field with unixtime in seconds and I need it to be in millis开发者_StackOverflow中文版econds. Just a simple query to update the columns time and changetime by multiplying by 1000.

I have a field with unixtime in seconds and I need it to be in millis开发者_StackOverflow中文版econds. Just a simple query to update the columns time and changetime by multiplying by 1000.

I had a script to do this, but lost it. Totally having a Friday.


UPDATE yourtable
SET `time` = `time` * 1000, `changetime` = `changetime` * 1000


If you just want to update all your current rows then:

update tablename set column_name=column_name*1000 where 1


Update yourtable
Set column=column*1000

Replace 'yourtable' and 'column' by the actual names, obviously.

0

精彩评论

暂无评论...
验证码 换一张
取 消