Oracle常規操作整理(容易遺忘的)持續更新...
阿新 • • 發佈:2018-11-26
1、檢視自己建立的序列;
select * from user_sequences;
2、刪除表之後,表其實是被放進了回收站,這時 select * from tab;會看到以BIN$開頭的表,這些是drop刪除的表,還在回收站:用 以下命令清空回收站
purge recyclebin ;
3、修改表中欄位長度;
alter table 表名 modify 欄位名 varchar2(32);
4、操作表中資料(基礎);
增:(按表結構新增,表中有幾個欄位,對應幾個值)insert into 表名 values('值1','值2','值3'...);
(選擇性新增) insert into 表名(欄位名一,欄位名三,欄位名五) values('值1','值3','值5');
刪:delete from 表名 where id=1;
改:update 表名 set 列名 = '要改為的內容' where id = 1;
查:select * from 表名 where id in(1,2,3,4,5) and name is not null;