1. DEMO: SELECT REGEXP_SUBSTR('1,2', '[^,]+', 1, LEVEL) FROM DUAL CONNECT BY REGEXP_SUBSTR('1,2', '[^,]+', 1, LEVEL) IS NOT NULL 2.应用场景,具体看业务需求 select to_char(wm_concat(f.title)) from (select 1 id, '短信' title from dual …
oracle中字符串连接用|| create or replace procedure testIf(idid number) is v_name stu.name%type; v_age stu.age%type; begin then update stu where id = idid; select age into v_age from stu where id = idid; dbms_output.put_line('age'||v_age);--oracle中字符串连接用|| e…
1. Oracle自带列转行函数listagg: 实例: with temp as( select 'China' nation ,'Guangzhou' city from dual union all select 'China' nation ,'Shanghai' city from dual union all select 'China' nation ,'Beijing' city from dual union all select 'USA' nation ,'New York…
ALTER DATABASE character set INTERNAL_USE ZHS16GBK; ALTER DATABASE CHARACTER SET ZHS16GBK; oracle修改字符编码 1 1 打开命令窗口 2 2 查看当前字符编码 3 3 执行命令 4 oracle修改字符编码 打开命令窗口 sqlplus shybt/shybt@localhost:1521/orcl 查看当前字符编码 select userenv('lan…
oracle查看字符集和修改字符集 : 查看数据库服务器的字符集: select userenv('language') from dual ; 登陆用dba: 停掉数据库 : shutdown immediate; 启动数据库到mount状态下 : STARTUP MOUNT; ALTER SESSION SET SQL_TRACE=TRUE; ALTER SYSTEM ENABLE RESTRICTED SESSION; ; ; 启动数据库 : Alter database open 设置字…
Oracle 切割字符查询 select * from view_psbaseinfo where DECODE('410782001125,411100000043', '', NULL, '410782001125,411100000043') IS NULL or PSCODE in (SELECT REGEXP_SUBSTR('410782001125,411100000043', '[^,]+', 1, LEVEL) AS PSCODE FROM DUAL CONNECT BY LEV…
DECLARE M ); BEGIN FOR I IN ( WITH T AS (SELECT REVERSE('i,am,a,test,hahahhah') AS STR FROM DUAL) SELECT LEVEL, REGEXP_SUBSTR(T., LEVEL) STR_SINGLE FROM T CONNECT ) LOOP SELECT REVERSE(I.STR_SINGLE) INTO M FROM DUAL; DBMS_OUTPUT.PUT_LINE(M); END LOOP…