摘要: --查询工作是clerk的员工并且所在部门的人数select e.empno,e.ename,d.deptno,d.dname,ed.coufrom emp e,dept d,(select deptno,count(empno)cou from emp group by deptno) ed where e.job='CLERK'and d.deptno=e.deptno and e.deptno=ed.deptno;--建表create table 表名( 字段1 类型 , 字段2 类型 [default 默认值], 字段3 类型 [default 默认值]);--设置每行 阅读全文
posted @ 2012-09-07 16:16 紫韵轩 阅读(273) 评论(0) 推荐(0) 编辑
摘要: ----自动生成合同编号的序列create sequence test_sq --序列 start with 1000 --起始值 increment by 1 --增量 nomaxvalue --没有最大值10的27次方 minvalue 1 --最小值 nocycle --不循环 cache 5; --缓存量select to_char(sysdate,'yyyymmdd')||test_sq.nextval from dual; --||拼接字符串。 20110530+序列1000开始test_sq.nextval--取下一个序列值test_sq.currval --取当 阅读全文
posted @ 2012-09-07 16:15 紫韵轩 阅读(335) 评论(0) 推荐(0) 编辑