1
resposta

Não consegui rodar TRIM

Segue o código:

SELECT TRIM ('     OLÁ     ' ) AS LOL;

O Erro foi:

Error Code: 1630. FUNCTION sucos_vendas.TRIM does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual 0.000 sec

1 resposta

Vitor,

Putz... quebrei a cabeça aqui, mas descobri!

NÃO pode ter espaço entre o nome da função "TRIM" e o primeiro parênteses "(". Esta regra deve valer para qualquer função.

Tente assim:

SELECT TRIM(' OLÁ ' ) AS LOL;

Veja também:

==========================================================

MySQL TRIM() Function

SELECT TRIM(' SQL Tutorial ') AS TrimmedString;

Works in: From MySQL 4.0

https://www.w3schools.com/sql/func_mysql_trim.asp

==========================================================

MySQL TRIM() function

Last update on August 09 2022 03:30:37 (UTC/GMT +8 hours)

SELECT TRIM(' trim ');

https://www.w3resource.com/mysql/string-functions/mysql-trim-function.php

==========================================================

Ei... acho que o MS SQL Server não tem estas frescuras...

[]'s,

Fabio I.

P.S (Post Script): Por favor, não esqueça de fechar o tópico e de me pontuar! Valew! KKKKK!!!

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software