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(如 Oracle 数据库)中,TRANSLATE 函数用于将字符串中的一个或多个字符替换为另一个字符集中的相应字符。如果目标字符集中的某个字符没有对应的源字符,则该字符会被删除。 语法: TRANSLATE(string, from_chars, to_chars) string: 要翻译的原始字符串。 from_chars: 包含要替换的字符集的字符串。 to_...
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://www.banping.com/2009/05/18/oracle_function_translate/ Oracle提供了一个字符替换函数translate,不同于replace函数的是,translate函数是字符级别的替换,而不是字符串的替换。 其语法如下: TRANSLATE ( expr , from_string , to_string ) ...
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;
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.
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) ...