What's the best way to calculate similarity between rows in a table based on association?
Posted
by André Pena
on Stack Overflow
See other posts from Stack Overflow
or by André Pena
Published on 2010-06-13T01:15:22Z
Indexed on
2010/06/13
1:22 UTC
Read the original article
Hit count: 359
Suppose each Person has a collection of favorite Books.
So I have a table for:
- Person
- Book
- The association between Person and Book (joint table for MxN)
I want to fetch the Persons that are similar to a Person1 based on the favorite Books overlaping. That is: The more books they have in common, the more they are similar.
I don't have to use only SQL to solve this problem. I could use programming also. I'm using SQL Server 2008 and C#.
What solution would you experts use?
© Stack Overflow or respective owner