Hi,
I will like to have, along with my quesry result, another
column that will store the number of the row, for example:
1 query results...
2 query results...
3 query results...
how can i do this?
Thanks!Refer to following url
HOW TO: Dynamically Number Rows in a Select Statement
http://support.microsoft.com/default.aspx?scid=KB;EN-US;q186133
if you have any unique field in the table then you can try a query something
like this:
Ex:
use northwind
go
select (select count(customerid) from customers where customerid <=a.customerid) rank,
*
from customers a
go
--
-Vishal
"Juan Carlos" <jcarlos_mn@.hotmail.com> wrote in message
news:0bf201c34249$de23a670$a501280a@.phx.gbl...
> Hi,
> I will like to have, along with my quesry result, another
> column that will store the number of the row, for example:
> 1 query results...
> 2 query results...
> 3 query results...
> how can i do this?
> Thanks!|||http://www.aspfaq.com/2427
--
Aaron Bertrand, SQL Server MVP
http://www.aspfaq.com/
Please reply in the newsgroups, but if you absolutely
must reply via e-mail, please take out the TRASH.
"Juan Carlos" <jcarlos_mn@.hotmail.com> wrote in message
news:0bf201c34249$de23a670$a501280a@.phx.gbl...
> Hi,
> I will like to have, along with my quesry result, another
> column that will store the number of the row, for example:
> 1 query results...
> 2 query results...
> 3 query results...
> how can i do this?
> Thanks!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment