SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Number rows in a sql query
-
Jul 10, 2002, 06:25 #1
- Join Date
- May 2002
- Location
- United States
- Posts
- 457
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Number rows in a sql query
I know that this is a little bit off topic, but is there a way in ms. Access or sql to number the rows of a query?
ie.
numrows field 1
------- -------
1 afffdfds
2 kjljkl
3 hhfdfd
I can do it in a report, but i can;t get it to work with a query. Any help would be greatly appreciated!!
-
Jul 10, 2002, 07:23 #2
- Join Date
- Mar 2002
- Location
- Svíþjóð
- Posts
- 4,080
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Something like this:
Code:select (select count(t1.id) from table as t1 where t1.id <= t2.id) as numrows, t2.id as id, t2.field1 as field1 from table as t2 order by t2.id
Bookmarks