ERROR: syntax error at or near ")" LINE 1: ...BY CASE WHEN ( tags LIKE '%|8|%' ) THEN 0 WHEN () THEN 3 E... ^