大家在應用ORACLE的時候可能會遇到很多看起來不難的問題
對ORACLE高手來說是不用看的
ASCII()
SELECT CHAR(
SELECT ASCII(
SELECT CONCAT(COL
SELECT COL
SQL>SPOOL C:\ABCD
SQL>select * from table;
SQL >spool off;
SQL>SET AUTOTRACE ON ;
SQL>SELECT * FROM TABLE;
OR
SQL>SELECT * FROM v$filestat ;
可以查看IO數
alter table table_name modify (field_name varchar
改大行
select * from table_name where trunc(日期字段)=to_date(
create table BSYEAR (d date);
insert into BSYEAR
select to_date(
from all_objects
where rownum <= to_char(to_date(
alter table old_table_name rename to new_table_name;
sqlcode=
SELECT * FROM dba_sys_privs ;
從功能上說沒有區別
進入dbastudio
pfile就是Oracle傳統的初始化參數文件
ifile類似於c語言裡的include
spfile是
startup後應該只可接pfile
SELECT * FROM empLOYEE WHERE ROWNUM < n
ORDER BY empno;
SQL>conn internal ;
SQL>show parameter processes ;
一般不可以﹐不建議這樣做的
select (select count(id) from aa)+(select count(id) from bb) 總數 from dual;
select * from
(select t
where rank = N;
select add_months(sysdate
It is
應該是tnsnames
建立一個臨時的redolog組
沒有限制
SELECT CEIL(N) FROM DUAL;
SELECT FLOOR(N) FROM DUAL;
SELECT LAST_DAY(SYSDATE) FROM DUAL;
IMP SYSTEM/MANAGER FILE=AA
SQL>SELECT * FROM user_constraints WHERE CONSTRAINT_TYPE=
SQL>SELECT * FROM BSEMPMS_OLD INTERSECT SELECT * FROM BSEMPMS_NEW;
SQL>SELECT * FROM BSEMPMS_OLD UNION SELECT * FROM BSEMPMS_NEW;
SQL>SELECT * FROM BSEMPMS_OLD UNION ALL SELECT * FROM BSEMPMS_NEW;
SQL>SELECT * FROM BSEMPMS_OLD MINUS SELECT * FROM BSEMPMS_NEW;
建sequence seq_custid
create sequence seq_custid start
建表時:
create table cust
{ cust_id smallint not null
insert 時:
insert into table cust
values( seq_cust
日期的各部分的常用的的寫法
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TRUNC(SYSDATE) FROM DUAL;
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE) FROM DUAL;
SELECT TO_DATE(
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
SELECT TO_CHAR(SYSDATE
From:http://tw.wingwit.com/Article/program/Oracle/201311/18701.html