>>>> 2012/10/16 12:57 -0400, Michael Dykman >>>> your now() statement is getting executed for every row on the select. try ptting the phrase up front as in: set @ut= unix_timestamp(now()) and then use that in your statement. <<<<<<<< Quote:
Functions that return the current date or time each are evaluated only once per query at the start of query execution. This means that multiple references to a function such as <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_now>NOW() within a single query always produce the same result. (For our purposes, a single query also includes a call to a stored program (stored routine, trigger, or event) and all subprograms called by that program.) This principle also applies to <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_curdate>CURDATE(), <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_curtime>CURTIME(), <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_utc-date>UTC_DATE(), <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/functions.html#function_utc-time>UTC_TIME(), <file:///C:/Program%20Files/MySQL/MySQL%20Server%205.5/HELP/f! unctio ns.html#function_utc-timestamp>UTC_TIMESTAMP(), and to any of their synonyms. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/mysql