You forgot to add the condition: WHERE SUBSTR(column, -1, 1) = ','
Quassnoi caught another problem - REPLACE returns null - you cannot use it inside "set"
Full sql:
UPDATE table SET column = SUBSTR(column, 0, length(column)-1) WHERE SUBSTR(column, -1, 1) = ',';
This ensures that you only replace lines that have values ββthat end with ","
source share