Query update

This commit is contained in:
Neil Alexander 2020-12-18 18:19:57 +00:00
parent b9262eab70
commit 44c53e32f8
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -92,7 +92,7 @@ const updateEventJSONSQL = "" +
*/
const selectCountStateChangesInRangeSQL = "" +
"SELECT COUNT(*), MIN(id), MAX(id) FROM syncapi_output_room_events" +
"SELECT COUNT(*), coalesce(MIN(id), 0) AS min, coalesce(MAX(id), 0) AS max FROM syncapi_output_room_events" +
" WHERE (id > $1 AND id <= $2) AND ((add_state_ids IS NULL OR add_state_ids = '') OR (remove_state_ids IS NULL OR remove_state_ids = ''))"
const selectStateInRangeSQL = "" +