码迷,mamicode.com
首页 > 数据库 > 详细

DB2:FETCH FIRST 1 ROWS ONLY

时间:2017-06-08 14:52:20      阅读:299      评论:0      收藏:0      [点我收藏+]

标签:div   desc   http   logs   分享   row   .com   blog   image   

DB2:FETCH FIRST 1 ROWS  ONLY,在Oracle中使用where rownum=1代替
DB2:
 SELECT INSTORAGENO  FROM
                               (
                               SELECT max(AUDITINGTIME) AUDITINGTIME ,INSTORAGENO  FROM T_IN_STOREROOM 
                               order by AUDITINGTIME desc
                               FETCH FIRST 1 ROWS  ONLY
                               ) a 
Oracle:
SELECT INSTORAGENO  FROM
                        (
                        SELECT max(AUDITINGTIME) AUDITINGTIME ,INSTORAGENO  FROM T_IN_STOREROOM 
                        order by AUDITINGTIME desc
                        ) a  where rownum=1

例如:

技术分享

DB2:FETCH FIRST 1 ROWS ONLY

标签:div   desc   http   logs   分享   row   .com   blog   image   

原文地址:http://www.cnblogs.com/rwh871212/p/6962531.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!