-- Fail when ISOK_QUERIES.First_Run is after Last_Run

UPDATE isok_queries
  SET first_run = last_run + '1 day'::INTERVAL
  WHERE iqname = 'query1';
