Create SQL 2000 View that assigns row number to each row

完了済み 投稿 Oct 29, 2013 着払い
完了済み 着払い

I need a SQL 2000 View that assigns a row number to each record. In later versions of SQL, this can be accomplished using the WITH statement. Unfortunately, this feature did not exist for this version. The statement would work something like this:

select id, product_code, ROWNUM

from subscriptions

where prod_type = 'chapt'

and status = 'a'

The challenge is creating that ROWNUM field, or whatever you'd like to call it. The value should start with 1 and increment by 1 for each new row. When the id value changes, the rownum should start back with 1 and increment by 1. For example:

id product_code rownum

1025 gold 1

1025 nregion 2

1025 florida 3

1036 southeast 1

1036 magazine 2

SQL

プロジェクトID: #5074476

プロジェクトについて

2個の提案 リモートプロジェクト アクティブ Oct 29, 2013

アワード:

Prateekagra

hi as per the discussion task has been done and also given to you..................................................................

$75 USD 1日以内
(3レビュー)
3.7