TimeStampDiff not working in MySql 5.0.3
Hey there -- Doing a simple TIMESTAMPDIFF query and I keep getting an error for my query. I tried the exact same query on a MySQL 5.5 engine and it worked fine..
SELECT TIMESTAMPDIFF(SECOND, current_timestamp(), current_timestamp()) AS time;
This is just a simple query to test the function out, normally it would return 0 on MySql 5.5, but on my 5.0 database it fails to run..
I've loo开发者_如何转开发ked up if the function wasn't yet implemented, and it seems that in 5.0 it was introduced.. so not sure why this isn't working? I've checked the documentation on this function in 5.0 manual and it seems to be the same as 5.5..
Anyone know the work around? Thanks in advance
It seems there were some bugs with that function, on old versions of MySQL 5.0.x -- here's an example : Erratic behaviour of TIMESTAMPDIFF()
Note that MySQL 5.0.3 is really old -- you really should update to a more recent version :
- You'll get more support
- Lots of bug fixes
- New features and enhancements
- And, probably, better performances
精彩评论