nyazoom/queries/records/get_and_update.sql

6 lines
156 B
SQL

UPDATE records
SET downloads = downloads + 1
WHERE
cache_name = ?
AND downloads < max_downloads
AND julianday('now') - julianday(uploaded) < 5;