NEED NUMBER ROWS IN SQL SELECT
Hi guys,
I'm trying find a way to create a row with the number of each row.
For example:
.png)
In the SQL above, i want a way to create a collum with the number of corresponding row, in this case:
1
2
3
In SQl SERVER i can use FOR, RANK or ROM_NUMBER to do this, but, i can't find a way to do the same in cache SQL.
Can someone help me?
Thank you.
Comments
have a look at the window functions in the documentation
Hi @Caio Timm,
You can do something similar to this
SELECT ROW_NUMBER() OVER (ORDER BY <column_name>) AS RowNumber, <other_columns> FROM <table_name>
Eg:
.png)
See for Caché 2018.1:
PS: It is a pity that again no one pays attention to the version of the product.
https://docs.intersystems.com/iris20221/csp/docbook/Doc.View.cls?KEY=RS…
Mentions ROW_NUMBER() is supported in InterSystems IRIS Data Platform 2022.1.
Assume it's not supported in $ZV: Cache for UNIX (Red Hat Enterprise Linux 5 for x86-64) 2010.2.3 (Build 702) Tue Feb 15 2011 14:21:10 EST
From which version is it supported ?