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';
Print | posted on Wednesday, September 11, 2013 5:19 PM | Filed Under [ SQL DB2 ]