随笔分类 -  Oracle

摘要:GUID N VARCHAR2(40) N SYS_GUID() 阅读全文
posted @ 2021-08-18 16:52 zq爱生活爱代码 阅读(50) 评论(0) 推荐(0)
摘要:--create or replace type pos_row as object ( pos_value VARCHAR2(40), digit VARCHAR2(10) ) --CREATE OR REPLACE TYPE v_respos IS TABLE OF pos_row --CREA 阅读全文
posted @ 2021-08-18 16:30 zq爱生活爱代码 阅读(303) 评论(0) 推荐(0)
摘要:赋权:grant execute on function1 to ucr_dtb1;收回执行权限:revoke execute on function1 from ucr_dtb1; 在ucr_dtb1用户下执行函数: select exp_dtb1.function1('xxxxx') from 阅读全文
posted @ 2021-07-30 09:35 zq爱生活爱代码 阅读(351) 评论(0) 推荐(0)
摘要:函数wm_concat(列名),该函数可以把列值以","号分隔起来,并显示成一行,接下来上例子,看看这个神奇的函数如何应用准备测试数据 create table test(id number,name varchar2(20)); insert into test values(1,'a'); in 阅读全文
posted @ 2021-07-29 09:44 zq爱生活爱代码 阅读(240) 评论(0) 推荐(0)
摘要:unpivot列转行函数 select 字段 from 数据集 unpivot(自定义列名/*列的值*/ for 自定义列名/*列名的别名,自己定义*/ in(列名)) 注意 後面的是列名 create table Fruit(id int,name varchar(20), Q1 int, Q2 阅读全文
posted @ 2021-05-13 22:11 zq爱生活爱代码 阅读(253) 评论(0) 推荐(0)
摘要:-- A表B表 都有的數據,把B表的數據更新到A表-- A表沒有數據,B表有的,則插入到A表merge into ZQ_A A using ZQ_B b on (a.name=b.name) when matched then update set a.age=b.age when not matc 阅读全文
posted @ 2021-05-13 22:10 zq爱生活爱代码 阅读(48) 评论(0) 推荐(0)
摘要:declare type type_array is varray(5) of varchar2(20); var_array type_array := type_array(); --var_array type_array := type_array('2','2','3','4'); -- 阅读全文
posted @ 2021-04-25 16:23 zq爱生活爱代码 阅读(121) 评论(0) 推荐(0)