; 8 / TOBeOrnOttOBe PL/SQL procedure successfully completed. SQL> If you have more characters in the source string than in the replacement string, those characters are removed. No spaces appear in the result.
This Oracle tutorial explains how to use the Oracle/PLSQLTRANSLATE functionwith syntax and examples. Description The Oracle/PLSQL TRANSLATE function replaces a sequence of characters in a string with another set of characters. However, it replaces a single character at a time. For example, it ...
1.TRANSLATE这个函数的格式:TRANSLATE ( '原本的值','需要被替换的值','替换后的值') 2.便于理解的例子: 例子A(‘原本的值’中如果有值不存在于‘需要被替换的值’,不存在于‘替换后的值’)的查询效果: 1 SELECTTRANSLATE ('ABCDEFGH','ABCDEFG','1234567')ASNEW_STRFROMDUAL; 转换思路('需要被替换的...
在SQL(如 Oracle 数据库)中,TRANSLATE 函数用于将字符串中的一个或多个字符替换为另一个字符集中的相应字符。如果目标字符集中的某个字符没有对应的源字符,则该字符会被删除。 语法: TRANSLATE(string, from_chars, to_chars) string: 要翻译的原始字符串。 from_chars: 包含要替换的字符集的字符串。 to_...
SQL> delete from a, where length(translate(trim(a.t_no), '0123456789' || a.t_no, '0123456789')) <> length(trim(a.t_no)); 2.replace 语法:REPLACE(char, search_string,replacement_string) 用法:将char中的字符串search_string全部转换为字符串replacement_string。
55.Oracle数据库SQL开发之 高级查询——使用TRANSLATE函数 欢迎转载,转载请标明出处:http://blog.csdn.net/notbaron/article/details/49805769 TRANSLATE(x,from_string,to_string)函数在x中查找from_string中的字符,并将其转换成to_string中对应的字符。
In Oracle, the TRANSLATE(string, from_string, to_string) function allows you to replace all occurrences of each character in from_string to the corresponding character in to_string. In MySQL you can use nested REPLACE expressions or an user-defined function. ...
参考文档如下:http://www.banping.com/2009/05/18/oracle_function_translate/ Oracle提供了一个字符替换函数translate,不同于replace函数的是,translate函数是字符级别的替换,而不是字符串的替换。 其语法如下: TRANSLATE ( expr , from_string , to_string ) ...
The TRANSLATE() function allows you to make several single-character, one-to-one translations or substitutions in one operation. Syntax The following illustrates the syntax of the Oracle TRANSLATE() function: TRANSLATE(string, from_string, to_string)Code language: SQL (Structured Query Language) ...
dual; -- Dual is a dummy table in Oracle, used here as a placeholder since we're not actually querying any table Explanation: This SQL code is a SELECT statement that demonstrates the use of the TRANSLATE function to perform character translation on a string. ...