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:
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.
Product version: Caché 2018.1
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:
See for Caché 2018.1:
PS: It is a pity that again no one pays attention to the version of the product.