I was reviewing a "top 3 products per category" report last week and found a bug that had been live for months. One category showed four products. Another showed the same product twice. The query used RANK(). It should have used ROW_NUMBER(). They look interchangeable in a tutorial and behave completely differently the moment your data has ties.... Weiterlesen
Intelligence View
⚡ tsecurity.de Intelligence
ROW_NUMBER vs RANK vs DENSE_RANK: one of them silently duplicates your Top-N
I was reviewing a "top 3 products per category" report last week and found a bug that had been live for months. One category showed four products. Another…