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;
/ 执行缓冲区的命令
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;