I recently needed to test for similarity between several sets of time series data – specifically response curves and attrition curves – and find the most similar data sets. I’m in no way an expert on curve fitting but using the squared deviation method seemed to work quite well and lends itself to a nice implementation in SQL so thought I’d share it here. Continue reading “Comparing Response and Attrition Curves in SQL”

## Generating an Integers Table

One of the first jobs I do when setting up any new database is to create a tool set of useful objects. And an integers table is normally the first of these – having a source of numbered rows is often handy for generating test data and to use in cross joins to add additional rows to a query. Generating a permanent table of values will save generating these on the fly whenever they are required. Continue reading “Generating an Integers Table”