--1.查询表中某个字段是否重复
select student_name from student group by student_name having count(0)>1
---2. 满足多个字段的表关联查询(表设计不合理)
select z. nsrm , f.tcm from xxjz z, xxjf f where z.nsbh||z.lsh=f.nsbh||z.lsh
select z.nsrm,f.tcm from xxjz z join xxjf on (z.nsbh=f.nsbh and z.lsh= j.lsh)
--3 sql substr(colm,start,end) 位置从0,1 开始结果一样, substr('fff'1,2) 结果 ff
select substr(z.nsrm, 1,length(z.nsrm)-2) name from xxjz z
----oracle分页查询
select tt.*
from ( select t.*,rownum n
from (select *
from zk_xxx
) t
where rownum<12
) tt
where tt.n>2