In sql I know how I could do this, but I want to g...
# suitescript
s
In sql I know how I could do this, but I want to get the row number of occurances in a search. How would I do that? So if an item was returned 3 times, the first row would have 1, 2nd row '2', and 3rd row '3'.
d
The
.asMappedResults()
returns an array. Just use the index value of the array.
s
I need it as a column on a search
d
You said sql so I assumed N/query. Sorry.
s
Ah, just meant that I could do this easily in sequel with partition and stuff
m
Untested but a ROW_NUMBER() analytic function might work
d
Or maybe DENSE_RANK
m
I think DENSE_RANK will give you duplicate values if there is a tie