日期:2014-05-17 浏览次数:21053 次
select aa.rn,nvl(bb.id,0) as id from (select rn from (select rownum as rn from dual connect by rownum<=9) a where a.rn in(1,2,3) ) aa left join t_table bb on aa.rn=bb.id
------解决方案--------------------
select nvl(t.id,0) from (select rownum as rn from t connect by rownum<=2) a left join t on t.id=a.rn