標籤:clob -- ble int add trunc 結構 使用 檔案路徑
支援的資料類型:
字元型
char定長最大2000
varchar2()變長最大4000
clob字元型大對象 最大4G
數字型
number範圍 -10的38次方到10的+38次方;
number(5,2)一個小數,有效位5個,小數點後2個數字
number(5)表示一個5位的整數
日期類型
date
timestamp
位元據
blob 保密性較高,存入資料庫/其他情況,保持在檔案伺服器,資料庫只存檔案路徑
建表:
create table student(
stuId varchar2(10),
age number(2),
birthday date
)
--添加一個欄位
alter table student add(name varchar2(10));
--修改欄位長度
alter table student modify (name varchar2(20));
null值:is null , is not null
select * from student t where t.name is not null;
savepoint 儲存點的使用
SQL> savepoint firstPoint;
Savepoint created
delete from student;
rollback to firstPoint;
drop from student;
delete from student where age>10;
truncate table student;--刪除所有記錄,表結構還在,不寫日誌,速度極快
簡單查詢:
列別名,函數nvl
select t.age "年齡" ,nvl( t.age,0) "年齡為null顯示0",t.rowid from STUDENT t;
字串串連:||
select t.name||‘-‘|| t.age from student t;
like操作符:
%:任意0到多個字元
_:單個任一字元
oracle系列(三)表操作基礎