Is there a function in DB2 to get the count from the last select.
db2> select var1,var3,var3,var4 from mytable where var5='test' fetch first 10 rows only;
db2> function to get last select count without fetch count.
The reason I'm asking this is that i'm migrating from mysql and they have a function to do this.
"A SELECT statement may include a LIMIT clause to restrict the number of rows the server returns to the client. In some cases, it is desirable to know how many rows the statement would have returned without the LIMIT, but without running the statement again. To get this row count, include a SQL_CALC_FOUND_ROWS option in the SELECT statement, then invoke FOUND_ROWS() afterward:
mysql> SELECT SQL_CALC_FOUND_ROWS * FROM tbl_name" WHERE id > 100 LIMIT 10;
mysql> SELECT FOUND_ROWS();