第一部分 基本语法 //拼接表字段 select id || 'is' || name from admin select * from emp where ename like '%s%';//模糊查询 select * from emp where mgr is null ; //查询表列为空的 to_date('2011-12-12','yyyy-mm-dd') //插入时间格式 to_date() //给表字段取别名 select id as 这是ID , name …
1.分页 select t2.* from (select rownum row, t1.* from your_table where rownum < ?) t2 where t2.row > ? 2.查看oracle数据库的某个表上已经建立了那些索引 select index_name from dba_indexes where table_name='your_table'; 3.如果表中有数据后给表增加约束会出现“无效的alter table选项”错误 alter table e…
1,查询插入 insert into user_role(account_id, role_id, create_user) select t.employee_id, 'BC8FBF8B1D9843A2AE83B2310AC57C28', 'ADMIN' from ACCOUNT t where employee_id not in (select account_id from user_role) 2, 按年查询 where o.YEAR=EXTRACT(YEAR FROM SYSDATE…