分页查询语句
语法简介 三重嵌套
select * from
(
Select emp.*,rownum as rn
from
(seect * from emp
)
where rownum <=9
)
where rn>=7
一、表字段的增删改:
添加字段的语法:alter table tablename add (column datatype [default value][null/not null],….);
修改字段的语法:alter table tablename modify (column datatype [default value][null/not null],….);
删除字段的语法:alter table tablename drop (column);
注:添加、修改、删除多列的话,用逗号隔开。
表字段的重命名:alter table tablename rename column FIELD_NAME to NEW_FIELD_NAME;
二、表的重命名:
alter table tablename rename to new_table_name;
三、主键的增删改查:
查找表约束:select constraint_name from user_cons_columns a where a.table_name=‘tablename‘;
增加表约束:alter table tablename add constraint pk_name primary key(column);
删除表约束:alter table tablename drop constraint constraint_name----(SYS_C002715);
修改表约束:1)禁用表主键:alter table tablename disable primary key;
2)启用表主键:alter table tablename enable primary key;
3)重命名表主键:alter table tablename rename constraint pk_id to new_pk_id;