Quite useful, I was missing this corner..
Below is quote from documentation as it is provided by code author.
// This method DOES NOT DO ANYTHING in and of itself. It's used to |
Quite useful, I was missing this corner..
Below is quote from documentation as it is provided by code author.
// This method DOES NOT DO ANYTHING in and of itself. It's used to |
I think this is exhaustive list for now:
| BWp | Botswana Pula |
| GBp | British Pound |
| ILs | Israeli Shekel |
| KWd | Kuwaiti Dinar |
| MWk | Malawian Kwacha |
| SZl | Swaziland Lilangeni |
| ZAr | South African Rand |
Should be one of:
CREATE TABLE #test ( id int, ProductName VARCHAR(25) ) insert into #test select 1, 'Apple' union all select 2, 'Apple' union all select 5, 'Apple' union all select 3, 'Orange' union all select 4, 'Orange' union all select 10, 'Orange'
SELECT * FROM #test SELECT maxID FROM ( SELECT MAX(id) AS maxID, ProductName AS nn, RANK() OVER (PARTITION BY ProductName ORDER BY id DESC) AS MyRank FROM #test GROUP BY id, ProductName ) tmp WHERE tmp.MyRank = 2