oracle note1

list 查看缓冲区的命令 l
/ 执行缓冲区的命令
change 改变缓冲区的命令 c
? set
save 保存缓冲区命令
@ 执行文件命令
get 查看文件命令
get c:\oracle\a.txt
edit 编辑缓存区文件
column id heading "编号"
describe
col dname format A10 heading "部门名称"
SQL> spool c:\aaaa.txt;
在此之间的都保存在aaaa.txt中
SQL> spool off
SQL> alter table table1 add remark nvarchar2(20);
SQL> alter table table1 drop column remark;
SQL> alter session set nls_date_format='yyyy-MM-dd HH:mi:ss';
SQL> select next_day(sysdate,'星期一') from dual;
SQL> alter session set nls_date_format='yyyy-MM-dd HH24:mi:ss';
SQL> select to_char(sysdate,'yyyy/mm/dd hh24:mi:ss')from dual;
SQL> select user from dual;
SQL> select sum(decode(sex,'男',1,0)),sum(decode(sex,'女',1,0)) from table1;
SQL> select * from table1;

ID NAME SEX AGE
---------- -------------------- -------------------- ----------
6 sex 女 15
1 name 男 12
2 age 男

15
SQL> select nvl(sex,'空') from table1;
在group by 后面出现的字段可以不再select后面出现 但是在select后面出现的字段必须在 group by 后

面出现

聚集函数不能作为条件出现在where后面 having
where 后面不能有聚集函数
select * from table1 where name like '%n%_';
create or replace trigger testtrigger1 before insert
on table1
for each row
begin
dbms_output.put_line('before insert');
end;
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值