如果qty的值不大,小于user_tab_columns的记录数,那么可以这样写
select a.id, a.desc from A, (select rownum r user_tab_columns) b where a.qty<=b.r order by a.id, a.desc;