--查询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 阅读(225)
评论(0) 编辑 收藏 所属分类:
Database