Skip to content

Instantly share code, notes, and snippets.

@iredun
Created June 17, 2014 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iredun/96915c2ff84c402a45f6 to your computer and use it in GitHub Desktop.
Save iredun/96915c2ff84c402a45f6 to your computer and use it in GitHub Desktop.
SQL запрос на изменение значения поля, если разница между текущей датой и датой в базе больше 5 минут но меньше 100 дней
$result=pg_query($this->db,"UPDATE sed_users SET \"ISONLINE\"=false WHERE ((CURRENT_DATE+LOCALTIME)-sed_users.\"LAST_ACTIVITY\") BETWEEN \"00:05:00\" AND \"100 days 23:59:59\"");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment