Evandro Ricardo Silvestre wrote: > Fernando Bossini wrote: >> Opa!!! >> >> SQL: >> >> select cont_codi, cont_desc >> from conta >> where cont_codi like '%1%' >> >> >> ERRO NO PGADMIN: >> >> ERROR: operator does not exist: integer ~~ unknown >> LINE 3: where cont_codi like '%1%' >> ^ >> HINT: No operator matches the given name and argument type(s). You >> might need to add explicit type casts. >> >> ********** Erro ********** >> >> ERROR: operator does not exist: integer ~~ unknown >> SQL state: 42883 >> Dica: No operator matches the given name and argument type(s). You >> might need to add explicit type casts. >> Caracter: 56 >> >> >> >> Existe alguma forma de fazer esse sql? Um like no campo inteiro? >> > Converte o campo para string. Isso ocorre porque não é feito o cast > automatico. > select cont_codi, cont_desc > from conta > where CAST(cont_codi as STRING) like '%1%' Ops, desculpe, o correto é as VARCHAR.
select cont_codi, cont_desc from conta where CAST(cont_codi as VARCHAR) like '%1%' Isso é vicio de ficar só escrevendo código sem mexer com banco =/ _______________________________________________ pgbr-geral mailing list [email protected] https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral
