
SQL
Latest record per customer in SQL: ROW_NUMBER and ties
I show how to select each customer's complete latest order, resolve ties and place filters so a marketing list answers the question you actually intended.
Tag
KajoData articles about advanced queries. Practical knowledge about data analysis, tools and careers.
Articles: 2

SQL
I show how to select each customer's complete latest order, resolve ties and place filters so a marketing list answers the question you actually intended.

SQL
A query with three CTEs can look impressive while calculating the wrong sales total. I build one analysis step by step, keeping track of row meaning, missing values and the order of calculations.