DB2:FETCH FIRST 1 ROWS ONLY

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_第1张图片

转载于:https://www.cnblogs.com/rwh871212/p/6962531.html

你可能感兴趣的:(DB2:FETCH FIRST 1 ROWS ONLY)