Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemenation of ROWNUM [CORE3129] #3506

Closed
firebird-automations opened this issue Sep 8, 2010 · 7 comments
Closed

Implemenation of ROWNUM [CORE3129] #3506

firebird-automations opened this issue Sep 8, 2010 · 7 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Alexandr Morozov (ak47_morozov)

Duplicates CORE2830

I create UDF that implemented mehanism to get a row number in sql query.
example return:
1 name1
2 name2
3 name3
In addition it can provide the line number by ID.
Example:

table:
id, name

10 Name1
13 Name2
27 Name3

select
rownum_id(http://p2.id, current_timestamp) as num, http://p2.name
from
table p1, table p2

returns:
num name
1 Name1
2 Name2
3 Name3
1 Name1
2 Name2
3 Name3

function may store unique values and return them, else return increment.
function mehanism base on c++ stl::map, and not so hard.
function compiled on many platform with gcc and msvc8.
function work correctly with many users and free of memory leak.

Can you add this feature in your SUDB directly? I may send the source code.
I want to see some implementation in firebird system funcs (thanx to round, trim, substring, dateadd, extract and other)

@firebird-automations
Copy link
Collaborator Author

Modified by: @dyemanov

security: Developers [ 10012 ] =>

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

I don't see any practical value in ROWNUM_ID, sorry. As for the regular ROWNUM, cannot it be substituted with the standard window function ROW_NUMBER?

@firebird-automations
Copy link
Collaborator Author

Commented by: Alexandr Morozov (ak47_morozov)

Thank you. I did not know about the development of row_number. But it would be only in firebird 3.0 (

@firebird-automations
Copy link
Collaborator Author

Commented by: @dyemanov

Your suggestion wouldn't go into any earlier version anyway, as v2.5 is in the feature-freeze mode and is being released and prior versions are in the maintenance mode and allow bugfixes only.

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Duplicate [ 3 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

Link: This issue duplicates CORE2830 [ CORE2830 ]

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant