News

Copyright © 2008-2019 Paula DiTallo

Tag Cloud



How do I do a SELECT TOP in SQL for DB2 on an iSeries (Power7) ?

This answer depends on what version of SQL you're running. A FETCH clause will work for all. Here's an example:

SELECT FLBILC,
       FLDATE,
       FLTCK#,
       FLCST#
  FROM PRDMETRO.FLHISTAF
 WHERE FLBILC = 'CMD'
 ORDER BY FLBILC
  FETCH FIRST 10 ROW ONLY;

The equivalent in T-SQL would be:

SELECT TOP 10 
       FLBILC,
       FLDATE,
       FLTCK#,
      FLCST#
 FROM PRDMETRO.FLHISTAF
  WHERE FLBILC = 'CMD';
    

Wednesday, September 11, 2013 5:19 PM

Feedback

No comments posted yet.


Post A Comment
Title:
Name:
Email:
Comment:
Verification: