0

I have a field with unixtime in seconds and I need it to be in milliseconds. 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.

3 Answers 3

1
UPDATE yourtable
SET `time` = `time` * 1000, `changetime` = `changetime` * 1000
1
  • darn ran into the bigint problem. now i need to create a new bigint column to support the new values.
    – shinyidol
    Sep 30, 2011 at 22:11
0

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

update tablename set column_name=column_name*1000 where 1

0
Update yourtable
Set column=column*1000

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.