Counter [message #268622] |
Wed, 19 September 2007 03:21 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
dimis283
Messages: 38 Registered: July 2007 Location: greece
|
Member |
|
|
I have a repeating frame, for example
name surname
dimis Miles
pavlos Kramnik
and I want to add a field that gives the count of each line
as
count name surname
1 dimis Miles
2 pavlos Kramnik
3 nikos karpow
How I can do it?
Dimis
|
|
|
|
|
Re: Counter [message #268794 is a reply to message #268628] |
Wed, 19 September 2007 14:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](http://www.orafaq.com/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21818 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Oh, yet another possibility:SQL> WITH test AS
2 (SELECT 'dimis' name FROM dual
3 UNION
4 SELECT 'pavlos' name FROM dual
5 UNION
6 SELECT 'nikos' name FROM dual
7 )
8 SELECT row_number() over (ORDER BY name) rn, name
9 FROM test;
RN NAME
---------- ------
1 dimis
2 nikos
3 pavlos
|
|
|