一个复杂sql文

想用sql实现一个功能:
如果不足8条纪录,添加至8条纪录。
超过8条纪录,剪切至8条纪录。
---------------------------------------------------------------

假设a表有列c1, c2, c3

select * from
(select c1, c2, c3 from a
union all
select null, null, null from all_objects where rownum<9
)
where rownum < 9;

===========================
oldwain
---------------------------
http://www.itpub.net/index.php?referrerid=32
http://www.linuxforum.net/forum/postlist.php?Cat=&amp;Board=oracle
http://www.oraclefan.net/

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus