Introduction
In this blog post, I would like to show how to implement hierarchical data clustering by using T-SQL.
Hierarchical clustering is probably the simplest method of cluster analysis. The are two basic types of this method - divisive (processing begins from the single cluster and on each step clusters are divided) and agglomerative (on the beginning each item resides in its own cluster, on the next steps we merge two closest clusters until all clusters are merged into single one).
The script below utilizes agglomerative approach.