title: counting rows in select clause with DB2
body: <p>I would like to query a DB2 table and get all the results of a query in addition to all of the rows returned by the select statement in a separate column.</p>
  
  <p>E.g., if the table contains columns 'id' and 'user_id', assuming 100 rows, the result of the query would appear in this format: (id) | (user_id) | 100.</p>
  
  <p>I do not wish to use a 'group by' clause in the query. (Just in case you are confused about what i am asking) Also, I could not find an example here: <a href="http://mysite.verizon.net/Graeme_Birchall/cookbook/DB2V97CK.PDF" rel="nofollow">http://mysite.verizon.net/Graeme_Birchall/cookbook/DB2V97CK.PDF</a>.</p>
  
  <p>Also, if there is a more efficient way of getting both these results (values + count), I would welcome any ideas. My environment uses zend framework 1.x, which does not have an ODBC adapter for DB2. (See issue <a href="http://framework.zend.com/issues/browse/ZF-905" rel="nofollow">http://framework.zend.com/issues/browse/ZF-905</a>.)</p>