I have a table called tb_codigos containing the following columns: cod , txt1 , txt2
I need to add the number of characters in the two columns txt1 and txt2 , in the example below the character size is 6, when I try to filter all the records that have more than 1 character it gives error, theoretically should appear all records. Is it some syntax error?
Example:
cod txt1 txt2 tamanho
1 abc abc 6
2 abc abc 6
3 abc abc 6
4 abc abc 6
Sql:
SELECT
cod,
txt1,
txt2
COALESCE (sum(
character_length(txt1)+
character_length(txt2)+
)) AS 'tamanho'
FROM tb_codigos
where tamanho > 1
GROUP BY cod
order by tamanho desc