Remove or Trim First or Last Few Characters in MySQL Database with SQL Entfernen oder Trim Erster oder letzten Zeichen in MySQL Datenbank mit 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. Eine andere nützliche String-Funktion in MySQL-Datenbank ist TRIM (), die Rückkehr einer Zeichenfolge nach dem Entfernen des passenden führenden oder nachgestellten Zeichen, auch bekannt als Präfixe oder Suffixe. It’s been described by MySQL reference as function that returns the string str with all remstr prefixes or suffixes removed. Es ist beschrieben worden von MySQL als Referenz-Funktion, liefert die Zeichenkette str mit allen remstr Präfixe oder Suffixe entfernt. If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed. Wenn keiner der Spezifikation BEIDE, FÜHRENDEN, oder TRAILING angegeben, so wird angenommen. remstr is optional and, if not specified, spaces are removed. remstr ist optional und, wenn nicht angegeben wird, werden Leerzeichen entfernt werden.
Syntax of TRIM(): Syntax von TRIM ():
TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str) TRIM ([(BEIDE | LEADING | TRAILING) [remstr] FROM] str), TRIM ([remstr AUS] str)
For example: Zum Beispiel:
SELECT TRIM(’ bar ‘); SELECT TRIM ( 'bar');
will return ‘bar’ (spaces dropped). zurück 'bar' (Leerzeichen fallen gelassen).
SELECT TRIM(LEADING ‘x’ FROM ‘xxxbarxxx’); SELECT TRIM (LEADING 'x' von 'xxxbarxxx');
will return ‘barxxx’ (only leading x characters is removed). wird zurückkehren "barxxx" (nur führende x Zeichen wird entfernt).
SELECT TRIM(BOTH ‘x’ FROM ‘xxxbarxxx’); SELECT TRIM (BOTH 'x' von 'xxxbarxxx');
will return ‘bar’ (leading and trailing xs is dropped). zurück 'bar' (vorangestellte und nachfolgende xs fallen gelassen wird).
SELECT TRIM(TRAILING ‘xyz’ FROM ‘barxxyz’); SELECT TRIM (TRAILING "xyz" von "barxxyz ');
will return ‘barx’ (trailing xyz is cleared). wird zurückkehren "Barx" (trailing xyz ist gelöscht).
This function is multi-byte safe. Diese Funktion ist Multi-Byte-sicher. 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. Und es kann auch verwendet werden, mit anderen SQL-Befehl wie UPDATE, um Änderung Änderung direkt auf Datenbank-Tabelle mit SQL-Anweisungen mit Tools wie phpMyAdmin.
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. WICHTIG: Dies ist eine Maschine übersetzt, die Seite wird "as is" ohne Garantie. Machine translation may be difficult to understand. Maschinelle Übersetzung Mai nur schwer zu verstehen. Please refer to Bitte wenden Sie sich an original English article Original Englisch Artikel whenever possible. wann immer dies möglich ist.
Share and contribute or get technical support and help at Aktie und einen Beitrag oder erhalten technische Unterstützung und Hilfe bei My Digital Life Forums My Digital Life Foren .
Related Articles Verwandte Artikel
- How to Find and Replace Text in MySQL Database using SQL Wie Sie auf Suchen und Ersetzen von Text in MySQL-Datenbank mit SQL
- Check and Optimize MySQL Database Automatically with Crontab/Cron Überprüfen Sie und optimieren MySQL-Datenbank automatisch mit crontab / cron
- MySQL Database Performance Tuning Best Practices Video Tutorial MySQL Datenbank-Performance Tuning Best Practices Video-Tutorial
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Aktivieren Sie Protokollierung von Abfragen Slow (Slow Query Log) in MySQL-Datenbank
- How to Remove and Drop Datafiles from Tablespace in Oracle Database Wie zu entfernen und Drop Datafiles von Tablespace in Oracle Database
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005 Deinstallieren und entfernen Sie mehrere Datenbank-Instanzen von Microsoft SQL Server 2005
- Oracle Database Link Oracle Database Link
- How to Escape Characters in Oracle PL/SQL Queries Wie zu entkommen Zeichen in Oracle PL / SQL-Abfragen
- Oracle EXP-00091 Error When Export Database Oracle EXP-00091 Fehler beim Export Datenbank
- Change Oracle Database User Password Ändern Oracle Database User Password
































