Is the SQL NOW() function dynamic or static when updating large tables from a single query?
mysql, sql
Solution
It does stay same for every data field and uses the execution start time. Head over to check it out.
http://www.mysqltutorial.org/tryit/query/mysql-now/#3
If you run the code you will notice that the time remain same with 5s sleep time.
There is another function `SYSDATE()` which is dynamic and always return the current time. This link might help you more.
Problem
If i write a single SQL statement that updates a date field on a very large MySQL database table is the SQL NOW() function's output dynamic in that it changes with the time while it runs or does it stay the same for every data field and uses its start time? IE; will: ``` UPDATE `table` SET `date` = NOW() ``` always result in the same result (eg. 2016-10-17 15:33:10 ) in all field regardless if it takes < 1 second or 1 hour to process? If it is dynamic. I would like a little bit of help to create a statement where it's not.