How to do SQL select top N … in AS400
Select col1,col2 from as400table where col1=’filter’ order by col1 fetch first N row only Remember to set an ORDER BY clause, because DB2 does not guarantee that the rows returned by FETCH FIRST N ROW ONLY are always the same N.