This seems to work (I removed the ‘u’ table from the FROM)
SELECT cf.user_id user_id, cf.updated_at granted_at
FROM user_custom_fields cf
WHERE cf.name = 'user_field_2'
AND (
cf.user_id IN (:user_ids)
OR :backfill
)
AND length(cf.value) > 1
This seems to work (I removed the ‘u’ table from the FROM)
SELECT cf.user_id user_id, cf.updated_at granted_at
FROM user_custom_fields cf
WHERE cf.name = 'user_field_2'
AND (
cf.user_id IN (:user_ids)
OR :backfill
)
AND length(cf.value) > 1