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 |
---|---|
40 | |
36 | |
34 | |
23 | |
17 |