Remove or Trim First or Last Few Characters in MySQL Database with SQLトリム削除したり、最初または最後の数文字をMySQLデータベースを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.別の有用な文字列関数にMySQLのデータベースのは、トリム( )が提供されるテキスト文字列を返すマッチングした後の先頭または末尾の文字を削除して、接頭辞や接尾辞としても知られています。 It’s been described by MySQL reference as function that returns the string str with all remstr prefixes or suffixes removed.で記述されたことのMySQLリファレンスとしてstrという文字列を返す関数をremstr接頭辞や接尾辞をすべて削除します。 If none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is assumed.両方の指定なしの場合、大手か、または末尾が与えられたとき、両方を想定します。 remstr is optional and, if not specified, spaces are removed. remstrはオプションであり、指定しない場合は、スペースが削除されます。
Syntax of TRIM():構文のトリム( ) :
TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str), TRIM([remstr FROM] str)トリム( [ (両方|リード|末尾) [ remstr ]より] str ) 、トリム( [ remstrより] str )
For example:例えば:
SELECT TRIM(’ bar ‘);選択トリム( 'バー' ) ;
will return ‘bar’ (spaces dropped).が返さの' bar ' (スペース下落) 。
SELECT TRIM(LEADING ‘x’ FROM ‘xxxbarxxx’);選択トリム(メインの[ x ]より' xxxbarxxx ' ) ;
will return ‘barxxx’ (only leading x characters is removed).が返さ' barxxx ' (のみリードx文字が削除さ) 。
SELECT TRIM(BOTH ‘x’ FROM ‘xxxbarxxx’);トリムを選択し(両方の[ x ]より' xxxbarxxx ' ) ;
will return ‘bar’ (leading and trailing xs is dropped).が返さの' bar ' (先頭または末尾のXSは下落) 。
SELECT TRIM(TRAILING ‘xyz’ FROM ‘barxxyz’);選択トリム(末尾に' XYZの'から' barxxyz ' ) ;
will return ‘barx’ (trailing xyz is cleared).が返さ' barx ' (末尾にxyzはクリア) 。
This function is multi-byte safe.この関数はマルチバイトセーフです。 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.とそれに使われることも、他のSQLコマンドを実行する更新プログラムの修正などのデータベースのテーブルを更新プログラムでデータを直接SQLステートメントでphpMyAdminなどのツールを使用しています。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要 :これは、機械翻訳ページで提供"現状有姿"を保証します。 Machine translation may be difficult to understand.機械翻訳を理解するのは難しいかもしれません。 Please refer toを参照してください original English articleオリジナルの英語記事索引 whenever possible.いつ可能です。
Share and contribute or get technical support and help atを共有して貢献や技術サポートとヘルプを得る My Digital Life Forums 私のデジタルライフフォーラム .です。
Related Articles関連記事
- Change or Set MySQL Long Query Time Value for log-slow-queries MySQLの長いクエリを変更または時間の値を設定することもできます。クエリが遅い
- How to Find and Replace Text in MySQL Database using SQL内のテキストを置換する方法を検索し、 MySQLデータベースを使用してのSQL
- MySQL Error 1170 (42000): BLOB/TEXT Column Used in Key Specification Without a Key Length MySQLのエラーが発生1170 ( 42000 ) :のBLOB /テキスト列で使用されキー仕様なしでキーの長さ
- WordPress MySQL SQL Query Error in WPDB Class WordPressのMySQLのSQLクエリにエラーが発生wpdbクラス
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4ウェブサーバーでは、 Windows XPをインストールするのApache2 、 PHP5とmysql4 -パート4
- How to Backup and Restore (Export and Import) MySQL Databases Tutorialどのようにバックアップと復元(エクスポートおよびインポート) MySQLデータベースのチュートリアル
- How to Delete Existing WordPress Post Revisions Stored/Saved既存のWordPressの投稿を削除する方法の改訂に格納/保存
- Enable Logging of Slow Queries (Slow Query Log) in MySQL Databaseログを有効に遅いクエリ(スロークエリログ)にMySQLのデータベースの
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005をアンインストールし、複数のデータベースのインスタンスを削除するMicrosoft SQL Server 2005の
- Delete, Remove or Drop Oracle Stored Packages with Drop Package削除、 Oracleのストアドパッケージを削除したり、ドロップドロップパッケージ



























