select rm, user_id, user_name, user_dept,user_position,user_salary
from ( select rownum rm,info.user_id, info.user_name, salary.*
from info, salary where info.user_id=salary.user_id
order by info.user_id ) where rm between 1 and 5;
from ( select rownum rm,info.user_id, info.user_name, salary.*
from info, salary where info.user_id=salary.user_id
order by info.user_id ) where rm between 1 and 5;
from ( select rownum rm,info.user_id, info.user_name, salary.*
from info, salary where info.user_id=salary.user_id
order by info.user_id ) a where rm between 1 and 5;
thank you all the same:)
like this:select * from (select rownum as m,a.* from scc_user a) where m between 3 and 8
(select rownum rid,user_id,user_name,user_dept,user_position,user_salary
from
(select info.user_name,salary.* from zdy_userinfo info, zdy_salary salary
where info.user_id=salary.user_id
order by info.user_id )
) where rid between 1 and 5;
在二层查询中不可用表名,无效,只需用列原名即可。
二层查询中不该有info_id,否则外部的user_id成为未明确定义的列。