Advance query. Rank most related fields in mysql
Let's assume we have a database like this: Project_tbl : ----------------- id | Project_name ----------------- 1 | A 2 | B 3 | C ----------------- personel_project_tbl : -------------------- user_id | Project_id -------------------- 1 | 1 2 | 2 3 | 1 3 | 2 2 | 3 -------------------- instrument_project_tbl : -------------------------- instrument_id | Project_id -------------------------- 1 | 1 1 | 2 2 | 2 2 | 1 1 | 3 -------------------------- Now, I need to sort the list of projects and rank them with regard to their similarity to the project A. For example: A and B have 1 users in common over