![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
![]() |

|
| Programming Error ! Programming error messages |
![]() |
|
How to get row number in sql?
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Administrator
Posts: 18,715
Join Date: Jan 2006
Rep Power: 10
IM:
|
SQL 2000 Statement to add rowindex to: select distinct(Description) as LawSpecialty from lawspecialty desired output LawSpecialty RowIndex Bankrupcy 1 Divorce 2 |
|
|
|
|
|
|
|
|
#2 (permalink) |
|
Administrator
Posts: 18,715
Join Date: Jan 2006
Rep Power: 10
IM:
|
SELECT a.Description, Id = ( SELECT COUNT(1) FROM (SELECT DISTINCT(Description) FROM LawSpecialty ) b WHERE a.Description > b.Description ) +1 FROM (SELECT DISTINCT(Description) FROM LawSpecialty ) A ) C where id in (1,2,3) |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|