I have an 'hours' table for restaurants with an 'open_time' and 'close_time' field in them. I need to create an event that at midnight each night both of those fields are updated by adding one day to them. (i.e. open_time is 2007-02-15 08:00:00 which then would be 2007-02-16 08:00:00). Because the table is in use i created a 'temp' table with the exact same fields and rows as the hours table to temporarily update these colums. I have the query that will do this but it is requring me to have a where statement state what row to update.
the query i have is:
Code:
UPDATE temp SET close_time = ( SELECT date_add( close_time, INTERVAL 1 DAY ) FROM hours where hours_id=1) WHERE hours_id = 1
how do i make this go through and update the temp table for each row?
Thanks,
John