I have a list of users that I am SELECT’ing from. I want the last 2 results. I can’t SORT the list since it’s a list of text. The 2 solutions I thought of is BOTTOM() as opposed to TOP but that doesn’t exist or to be able to simply flip the list but I can’t find a way to simply reverse the order of a LIST. OrderBy() does not work as it is unable to see the LAST_MODIFIED column from the table I am SELECT’ing from.
Solved! Go to Solution.
[YourSelectList]-TOP([YourSelectList], COUNT([YourSelectList])-2)
This will work best if you do this in a separate column from the column that selects the list, changing the name of the column in my example.
[YourSelectList]-TOP([YourSelectList], COUNT([YourSelectList])-2)
This will work best if you do this in a separate column from the column that selects the list, changing the name of the column in my example.
That works much better than my INDEX(SELECT, COUNT(SELECT) & INDEX(SELECT,COUNT(SELECT)-1)
User | Count |
---|---|
44 | |
29 | |
22 | |
20 | |
14 |