![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
oracle数据库
Howard_Stark
这个作者很懒,什么都没留下…
展开
-
oracle行转列
orcle行转列的几种方式:表结构如下:idstu_namecoursescore1Tomjava702Tomjsp503Tomscript724Tomvue845Bobjava736Bobjsp917Bobscript978Bobvue861、使用max + decode函数的方式SELECT stu_name,MAX(DECODE(course,'java ',score原创 2020-09-06 13:19:53 · 2184 阅读 · 0 评论 -
oracle中的几种简单循环方式
declarev_name varchar(20) :='liuhu';v_num number :=0;cursor test_cursor is select * from base_country;1、for循环beginfor i in 1..10 loopif mod(i,2)=0 thendbms_outout.put_line(v_name || i)...原创 2018-11-29 10:36:11 · 3237 阅读 · 0 评论 -
sql load 简单使用
数据文件:d:new.csv控制文件:d:test.ctl数据表:t_content_flow控制文件内容:load data infile 'D:\new.csv' append into table t_content_flowfields terminated by ';' trailing nullcols (year,month,day,hour,time...原创 2018-01-17 11:36:48 · 2630 阅读 · 0 评论 -
简单的存储过程
最简单的存储过程:create or replace procedure test asbegin dbms_output.put_line('Hello World!');end;调用:begin test;end;有输入和输出参数(参数类型可以和表的字段的类型一样)的存储过程:create or replace procedure test(in_var...原创 2018-11-29 10:36:47 · 403 阅读 · 0 评论 -
oracle集合
oracle中的集合分为:联合数组,嵌套表,可变数组三种类型。1、联合数组 索引表(key-value形式),索引值可以是无序的, 可以数字或字符串为下标来查找集合中的元素,元素数量不限。定义:TYPE JOIN_LIST IS TABLE of dataType index by indexType;JOIN_LIST:数组的名字dataType:指定的数组的数据类型index...原创 2018-12-12 17:01:38 · 424 阅读 · 0 评论