![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
oracle数据库--基本语句
ruru7989
这个作者很懒,什么都没留下…
展开
-
oracle函数基础
-- oracle中函数分两类,1:系统函数;2:自定义函数; -- oracle中函数与存储过程区别:1:函数必须返回一个值 -- 无参函数 -- 创建函数 create or replace function get_hello_msg return varchar2 as begin ret原创 2013-10-05 16:55:54 · 635 阅读 · 0 评论 -
oracle 行转列(用函数和游标完成)
create table students (student_id varchar2(32), student_name varchar2(180), student_age number ) insert into students values('1','金瑞','14'); insert into students values('2','中军','15'); insert into st原创 2013-10-05 17:36:52 · 1326 阅读 · 0 评论 -
oracle 存储过程基础
-- 1、创建简单存储过程,将学生年龄都改为10 create or replace procedure update_students as begin update students set student_age = 10; commit; end update_students; -- 2、查看存储过程在数据字典中的信息 select obje原创 2013-10-06 15:53:05 · 629 阅读 · 0 评论 -
oracle 程序包基础之基础
程序包可以将若干个函数和存储过程组织起来,作为一个对象进行存储。 程序包由两部分构成:规范(specification) 和主体(body) 规范:是程序包的公共接口。类似于面向对象编程中的接口-只定义方法名称和参数,并不真正实现方法。 1.创建程序包规范(create or replace package) 演示创建基于表students的规范 create or replace p原创 2013-10-07 21:04:29 · 580 阅读 · 0 评论 -
oracle 游标基础
一、显示游标 1、声明游标 (1)声明一个游标用来查询表students中的所有学生姓名 declare cursor cu_student_name is select student_name from students; 声明一个游标的时候一般还应当声明一个相应的变量,专门用来获取游标中的数据 (2)声明游标和游原创 2013-10-13 23:31:23 · 1127 阅读 · 0 评论 -
Oracle查询重复数据与删除重复记录方法
2012-05-31 00:00中国IT实验室佚名 比如现在有一人员表 (表名:peosons) 若想将姓名、身份证号、住址这三个字段完全相同的记录查询出来 select p1.* from persons p1,persons p2 where p1.id and p1.cardi转载 2014-04-11 09:24:28 · 507 阅读 · 0 评论 -
oracle 截取字符(substr),检索字符位置(instr)
select substr(TEACHETNAME, instr(TEACHETNAME, ':')+1 ) from ateacher; 截取TEACHETNAME字段中”:“之后的nei转载 2014-11-17 15:23:42 · 676 阅读 · 0 评论