上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页
摘要: -- 假设分了4个部门(存款部,ATM部,转出,转入) --每个月定期最后1天自动生成4张表的数据 --(数据来源:deal_record) -- 第一步:先把4张表建立起来 -- 存款表 create table r1( id number primary key, card_id varchar 阅读全文
posted @ 2018-04-02 15:12 我喜欢空格键 阅读(99) 评论(0) 推荐(0) 编辑
摘要: -- 一、立刻执行SQL语句 declare mysql varchar2(200); -- 保存SQL语句(所谓的动态SQL,就是一个可变的变量) begin mysql := 'select 1+1 from dual'; dbms_output.put_line(mysql); end; de 阅读全文
posted @ 2018-04-02 15:09 我喜欢空格键 阅读(107) 评论(0) 推荐(0) 编辑
摘要: create table bank_user( card_id varchar2(18) primary key, --身份证号码 user_name varchar2(100), 姓名 ye number, 余额(冗余的) status number 状态 1正常 0锁定);drop table 阅读全文
posted @ 2018-03-29 10:58 我喜欢空格键 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1.条件呢? --Basic loop ... end loop; declare i number:= 1; begin i:=100; loop i:= i + 1; dbms_output.put_line(i); if i>10 then exit; end if; end loop; en 阅读全文
posted @ 2018-03-27 09:53 我喜欢空格键 阅读(174) 评论(0) 推荐(0) 编辑
摘要: if (分3类) java if (条件) { .... } pl/sql if 条件 then ..... end if; select * from tt3 select age from tt3 where id=1 declare myage tt3.age%type; begin sele 阅读全文
posted @ 2018-03-26 15:15 我喜欢空格键 阅读(384) 评论(0) 推荐(0) 编辑
摘要: select * from tt3 -- 20年后多少岁 declare age tt3.age%type; dif tt3.age%type; begin select age into age from tt3 where id=1; dif := 20; -- 设置一个年龄差 age:= ag 阅读全文
posted @ 2018-03-26 10:17 我喜欢空格键 阅读(152) 评论(0) 推荐(0) 编辑
摘要: -- 有了SQL 为什么还需要PL/SQL -- SQL功能很强大,但如果是单1sql语句,没有流程控制 -- PL/SQL 是什么? --不仅仅实现流程控制,同时保留SQL本身所有的功能 --还提供变量、常量等支持 --提供更多数据类型的支持 --第一,学习PL/SQL块(有开头,有结尾,还有块之 阅读全文
posted @ 2018-03-25 19:10 我喜欢空格键 阅读(140) 评论(0) 推荐(0) 编辑
摘要: exp oa/123456@myorcl1 OWNER=oa file=c:\oa.dmp 在服务器,不需要@myorcl1 -- 用户的全量导出 exp oa/123456 OWNER=oa file=c:\oa.dmp 导入 imp oa/123456 full=y file=c:\oa.dmp 阅读全文
posted @ 2018-03-25 19:05 我喜欢空格键 阅读(83) 评论(0) 推荐(0) 编辑
摘要: create view t_myuser as select ooo.*, decode(sign((select avg(score)-struts from t_user_score where ke='struts')),1,'是的,低于平均分',-1,'高于平均分','跟平均分持平') lo 阅读全文
posted @ 2018-03-22 13:59 我喜欢空格键 阅读(84) 评论(0) 推荐(0) 编辑
摘要: --1.778秒 select sum(id) from t_user -- cpu (多线程执行) --1.778秒 --1.847秒 select /*parallel(a,4)*/ sum(id) from t_user a 阅读全文
posted @ 2018-03-22 13:57 我喜欢空格键 阅读(277) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页