can I get count() and rows from one sql query in sql server?

Posted by Greg on Stack Overflow See other posts from Stack Overflow or by Greg
Published on 2010-05-09T15:22:18Z Indexed on 2010/05/09 15:28 UTC
Read the original article Hit count: 194

Filed under:
|
|
|

I'd like to get the total count of results and top n rows of some query - is it possible in one statement?

I'd expect the results as:

count(..) column1 column2
125 some_value some_value
125 some_value some_value

Thank you in advance!

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server