能用正则表达式实现字符串换位吗
John, Smith 变成 Smith John
Solution:
SQL> select regexp_replace('John, Smith','^([^,*]{1,}),([^,*]{1,})','\2 \1') from dual;
REGEXP_REPLACE('JOHN,SMITH','^
------------------------------
Smith John
能用正则表达式实现字符串换位吗
John, Smith 变成 Smith John
Solution:
SQL> select regexp_replace('John, Smith','^([^,*]{1,}),([^,*]{1,})','\2 \1') from dual;
REGEXP_REPLACE('JOHN,SMITH','^
------------------------------
Smith John