1.TRANSLATE这个函数的格式:TRANSLATE ( '原本的值','需要被替换的值','替换后的值') 2.便于理解的例子: 例子A(‘原本的值’中如果有值不存在于‘需要被替换的值’,不存在于‘替换后的值’)的查询效果: 1 SELECTTRANSLATE ('ABCDEFGH','ABCDEFG','1234567')ASNEW_STRFROMDUAL; 转换思路('需要被替换的...
用法:将char中的字符串search_string全部转换为字符串replacement_string。 举例:SQL> select REPLACE('fgsgswsgs', 'fk' ,'j') 返回值 from dual; 返回值 --- fgsgswsgs SQL> select REPLACE('fgsgswsgs', 'sg' ,'eeerrrttt') 返回值 from dual; 返回值 --- fgeeerrrtttsweeerrrttts 分析:第一...
SQL 中的 TRANSLATE 函数 在SQL(如 Oracle 数据库)中,TRANSLATE 函数用于将字符串中的一个或多个字符替换为另一个字符集中的相应字符。如果目标字符集中的某个字符没有对应的源字符,则该字符会被删除。 语法: TRANSLATE(string, from_chars, to_chars) string: 要翻译的原始字符串。 from_chars: 包含要替换...
Oracle Database interprets the empty string as null, and if this function has a null argument, then it returns null. To remove all characters in from_string, concatenate another character to the beginning of from_string and specify this character as the to_string. For example, TRANSLATE(expr...
55.Oracle数据库SQL开发之 高级查询——使用TRANSLATE函数 欢迎转载,转载请标明出处:http://blog.csdn.net/notbaron/article/details/49805769 TRANSLATE(x,from_string,to_string)函数在x中查找from_string中的字符,并将其转换成to_string中对应的字符。
http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions216.htm#SQLRF06145 基本语法:translate(expr,from_string,to_string) translate 就是一个字符级别的替换: 如下所示: SQL> select * from v$version; BANNER --- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi PL/...
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. ...
函数用法都不一样,translate是逐个字符替换的 --包含ABC则替换为123 SELECT REPLACE('AbCaBc','ABC','123')FROM dual;--将A替换成1,B替换成2,C替换成3 SELECT TRANSLATE('AbCaBc','ABC','123')FROM dual;
TheTRANSLATE()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 OracleTRANSLATE()function: TRANSLATE(string, from_string, to_string)Code language:SQL (Structured Query Language)(sql) ...
Oracle TRANSLATE_USING function : The Oracle TRANSLATE ... USING converts char into the character set specified for conversions between the database character set and the national character set.