例えばSQL Server2000までなら、以下のようにAutoNum付き#tempテーブルを作ってデータを任意のソート順で格納してSEELCT文を発行(最後に#tempテーブルをdrop tableで破棄)してあげる方法でナンバーリングが可能だったと思います。
サンプル↓
--仮テーブル生成 ・・・①
create table #test(
RecordID int identity(1,1)
, code int
, period int
)
--データ格納 ・・・①
insert into #test
select code = 1301,Period = 200303 union all
select code = 1301,Period =200403 union all
select code = 1301,Period =200503 union all
select code = 1301,Period =200603 union all
select code = 1301,Period =200703 union all
select code = 1301,Period =200803 union all
select code = 2121,Period =200609 union all
select code = 2121,Period =200709 union all
select code = 2121,Period =200809 union all
select code = 7203,Period =200303 union all
select code = 7203,Period =200403 union all
select code = 7203,Period =200503 union all
select code = 7203,Period =200603 union all
select code = 7203,Period =200703 union all
select code = 7203,Period =200803
--検索 ・・・②
select * from #test
--破棄 ・・・③
drop table #test</blockquote>