オラクルを使用しています。
このサンプルのランダムなコンテンツを含むテーブルがあるとします。
columnA | columnB | content
--------------------------------
AfBkxZ | 292 | a
LDglkK | 181 | b
AfBkxZ | 51 | c
AfBkxZ | 315 | d
LDglkK | 808 | e
Cee89g | 1 | f
columnA の各値に一意の番号を持ち、その値を持つ columnA の行内に番号を記録するビューが必要です。
上記のサンプル データに基づいて求められる結果:
Group_number | Record_number | columnB | content
------------------------------------------------
1 | 2 | 292 | a (1.2)
3 | 1 | 181 | b (3.1)
1 | 1 | 51 | c (1.1)
1 | 3 | 315 | d (1.3)
3 | 2 | 808 | e (3.2)
2 | 1 | 1 | f (2.1)
で入手できrecord_number
ますrow_number() over (partition by columnA order by columnB asc)
。
group_number
実際には old のフレンドリなシーケンス エイリアスであるを取得するにはどうすればよいcolumnA
ですか?
ありがとうございました。