--查詢short_name有重的記錄
select short_name, count(*) from sys_catalog
group by short_name
having count(*)>1
?
--給short_name加上unique約束
alter table sys_catalog add unique (short_name)
--給column01加上check in約束
alter table son add constraint ck1 check (column01 in (1,2,3));
--查詢與當前系統時間最近的那個時間
select some_dt, sysdate-some_dt as gap from test_date
where sysdate-some_dt = (select min(abs(sysdate-some_dt)) from test_date)
--加字段
alter table?some_table add?some_column varchar2(20)
--找出所有包含_(下劃線)的字段;網上說用[_],但沒成功
select * from test_date where email like '%/_%' escape '/'
--啟動用戶
alter user scott account unlock;
--更改密碼
alter user scott indentified by tiger;
posted on 2006-11-15 13:50
Jcat 閱讀(227)
評論(0) 編輯 收藏 所屬分類:
Database