赞
踩
查询语句:
-
- SELECT TOP 20 NWID, NWTITLE, NW, NWEDITTIME, NWIMG
- FROM YW_NEWS
- ORDER BY NWEDITTIME DESC
-
出错提示:Message = "ORA-00923: 未找到要求的 FROM关键字"
原因:Oracle不支持TOP N 查询方式,需要用order by和rownum结合实现
解决方法:
-
- SELECT NWID, NWTITLE, NW, NWEDITTIME, NWIMG
- FROM (SELECT * FROM YW_NEWS ORDER BY NWEDITTIME DESC)
- WHERE ROWNUM <= 20
- ORDER BY ROWNUM ASC
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。