SQL SELECT Nth Record

Transact-SQL (TSQL) Quick Tips – SQL SELECT Nth Record I recently needed to compare two month end data snapshots.  The data was organized in a historical table with monthly datasets, dating back several years.  The specific need was to query changes between the previous dataset and the most recent.  The task itself isn’t difficult.  What … Read more

SQL ROW_NUMBER

The following code snippet will identify the MAX value on a given dimension(s), based on the value of a specified field.  This works well if you are trying to determine which value of a given dimension that you would like to display, if there are multiple options. By Definition:  Returns the sequential number of a … Read more