views:

112

answers:

0

Hi

I have a table that look like this :

username | privilges 
user1       privilge1
user1       privilge2
user1       privilge3
user2       privilge1
user2       privilge5
user2       privilge3
etc ......

i would like to group privliges based on similarity in percentage to other user . for example in the table : user1 and user2 has only 2 privilges in common (privilge1,privilge3) which are 66% . so if i search for similarities in priviges based on more then 50% it will group it like this :

user1  : privilge1 ,privilge3
user2  : privilge1 ,privilge3

Hope i was able to express myself well :)

Thanks ,

Zohar