select * from (select ti.id_card_, ti.name_ from t_teller_info_ ti, adm_agency_ a where ti.org_code_ = a.id_ and a.level_code_ like '%/6696/%') where rownum < = 10 此sql有什么问题么?
select * from (select ti.id_card_, ti.name_ from t_teller_info_ ti, adm_agency_ a where ti.org_code_ = a.id_ and a.level_code_ like '%/6696/%')tt where rownum < = 10
直接把rownum放在里层查询就行了, select ti.id_card_, ti.name_ from t_teller_info_ ti, adm_agency_ a where ti.org_code_ = a.id_ and a.level_code_ like '%/6696/%' where rownum < = 10;
多了个where select ti.id_card_, ti.name_ from t_teller_info_ ti, adm_agency_ a where ti.org_code_ = a.id_ and a.level_code_ like '%/6696/%' and rownum < = 10;
做分页应该还有个rownum大于select * from (select ti.id_card_, ti.name_,rownum from t_teller_info_ ti, adm_agency_ a where ti.org_code_ = a.id_ and a.level_code_ like '%/6696/%') t where rownum < = 10看这样行不行。
select * from (select ti.id_card_, ti.name_, rownum rn from t_teller_info_ ti, adm_agency_ a where ti.org_code_ = a.id_ and a.level_code_ like '%/6696/%' order by 唯一主键) where rn > 10 and rn < = 20
select ti.id_card_, ti.name_
from t_teller_info_ ti, adm_agency_ a
where ti.org_code_ = a.id_
and a.level_code_ like '%/6696/%' where rownum < = 10;
select ti.id_card_, ti.name_
from t_teller_info_ ti, adm_agency_ a
where ti.org_code_ = a.id_
and a.level_code_ like '%/6696/%' and rownum < = 10;
from (select ti.id_card_, ti.name_,rownum
from t_teller_info_ ti, adm_agency_ a
where ti.org_code_ = a.id_
and a.level_code_ like '%/6696/%') t
where rownum < = 10看这样行不行。
from (select ti.id_card_, ti.name_, rownum rn
from t_teller_info_ ti, adm_agency_ a
where ti.org_code_ = a.id_
and a.level_code_ like '%/6696/%' order by 唯一主键)
where rn > 10
and rn < = 20
只有一个rownum <= 10如何实现分页?