Remove or Trim First or Last Few Characters in MySQL Database with SQL Remover ou Trim Primeiro ou últimos caracteres de Dados MySQL com SQL
Another useful string function in MySQL database is TRIM() which will return a text string after removing the matching leading or trailing characters, also known as prefixes or suffixes. Outra função útil corda no banco de dados MySQL é TRIM () que irá retornar uma cadeia de texto após a remoção do líder correspondência ou trailing personagens, também conhecido como prefixos ou sufixos. It’s been described by MySQL reference as function that returns the string str with all remstr prefixes or suffixes removed. Tem sido descrito por referência o MySQL como função que retorna a string str com todos prefixos ou sufixos remstr removidos. If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. Se nenhum dos specifiers ambas, levando, ou trailing é dada, tanto é assumido. remstr is optional and, if not specified, spaces are removed. remstr é opcional, e se não for especificada, espaços são removidos.
Syntax of TRIM(): Sintaxe de TRIM ():
TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str) TRIM ([(AMBOS | CONDUZINDO | trailing) [remstr] FROM] str), TRIM ([remstr FROM] str)
For example: Por exemplo:
SELECT TRIM(’ bar ‘); SELECT TRIM ( 'bar');
will return ‘bar’ (spaces dropped). irá retornar 'bar' (espaços caiu).
SELECT TRIM(LEADING ‘x’ FROM ‘xxxbarxxx’); SELECT TRIM (CONDUZINDO 'x' FROM 'xxxbarxxx');
will return ‘barxxx’ (only leading x characters is removed). irá retornar 'barxxx' (apenas conduzindo x caracteres é removido).
SELECT TRIM(BOTH ‘x’ FROM ‘xxxbarxxx’); SELECT TRIM (ambos' x 'FROM' xxxbarxxx ');
will return ‘bar’ (leading and trailing xs is dropped). irá retornar 'bar' (líder e trailing xs é desceu).
SELECT TRIM(TRAILING ‘xyz’ FROM ‘barxxyz’); SELECT TRIM (trailing 'xyz' FROM 'barxxyz');
will return ‘barx’ (trailing xyz is cleared). irá retornar 'Barx' (trailing xyz é limpa).
This function is multi-byte safe. Esta função é multi-byte seguro. And it can also be used with other SQL command such as UPDATE to perform modification update directly on database table data with SQL statements using tool such as phpMyAdmin. Além disso, ela também pode ser utilizado com outros comandos SQL, tais como UPDATE para realizar modificações atualizar os dados diretamente no banco de dados tabela com comandos SQL utilizando como ferramenta phpMyAdmin.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Esta é uma página traduzida máquina que é fornecida "como está" sem garantia. Machine translation may be difficult to understand. A tradução automática pode ser difícil de compreender. Please refer to Por favor, consulte a original English article Inglês original article whenever possible. sempre que possível.
Share and contribute or get technical support and help at Compartilhe e contribuir ou obter suporte técnico e ajudar a My Digital Life Forums Minha vida digital Fóruns .
Related Articles Artigos relacionados
- Change or Set MySQL Long Query Time Value for log-slow-queries Alterar ou definir o MySQL Query Long Time Valor para log-slow-queries
- How to Find and Replace Text in MySQL Database using SQL Como Localizar e substituir texto em SQL usando o MySQL Database
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQL Error 1170 (42000): BLOB / TEXT Coluna Utilizado em Key Especificação Sem uma chave Comprimento
- WordPress MySQL SQL Query Error in WPDB Class WordPress MySQL consulta SQL erro na classe WPDB
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4 Instalar Web Server no Windows XP com Apache2, PHP5 e MySQL4 - Parte 4
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial Como a Backup e Restauração (de Importação e Exportação) Bancos de dados MySQL Tutorial
- How to Delete Existing WordPress Post Revisions Stored/Saved Como eliminar existentes WordPress Post revisões armazenadas / salvas
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Ativar registro de Consultas Lento (Slow Query Log) no MySQL Database
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005 Desinstalar e remover múltiplas instâncias do banco de dados Microsoft SQL Server 2005
- Delete, Remove or Drop Oracle Stored Packages with Drop Package Excluir, remover ou gota a gota Oracle armazenados pacotes pacote












