How do you perform a
Select top N * from as400table
type query against an as400/db2 database
I know this is a old thread but probably my answer help to someone, the best way to limit a number of rows in AS400 is using FETCH FIRST 1000 ROWS ONLY Example: select * from myschema.mytable_name FETCH FIRST 1000 ROWS ONLY
This will give you back the first 1000 rows.
Of course the 1000 you can change for whatever other value needed, 10, 25, 10000, etc.
At least this works for me in AS400 database (29-06-2020)
Best