开发者

simple field update mysql

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜