ussd-data-connect/queries.sql

8 lines
221 B
SQL

--name: extract-entries
SELECT key, value, updated FROM kv_vise
WHERE updated > (SELECT last_sync FROM ussd_sync LIMIT 1)
ORDER BY updated DESC
--name: update-cursor
-- $1: timestamp
UPDATE ussd_sync SET last_sync = ($1)