--查詢short_name有重的記錄
select short_name, count(*) from sys_catalog
group by short_name
having count(*)>1
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));
--查詢與當(dāng)前系統(tǒng)時(shí)間最近的那個(gè)時(shí)間
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)
--找出所有包含_(下劃線)的字段;網(wǎng)上說(shuō)用[_],但沒(méi)成功
select * from test_date where email like '%/_%' escape '/'
--啟動(dòng)用戶
alter user scott account unlock;
--更改密碼
alter user scott indentified by tiger;
alter table sys_catalog add unique (short_name)
--給column01加上check in約束
alter table son add constraint ck1 check (column01 in (1,2,3));
--查詢與當(dāng)前系統(tǒng)時(shí)間最近的那個(gè)時(shí)間
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)
--找出所有包含_(下劃線)的字段;網(wǎng)上說(shuō)用[_],但沒(méi)成功
select * from test_date where email like '%/_%' escape '/'
--啟動(dòng)用戶
alter user scott account unlock;
--更改密碼
alter user scott indentified by tiger;