I have a simple database table which has the following structure:
Teams Id_1 Id_2 Id_3
team_1 A B C
team_2 A B D
team_3 E F D
team_4 X null null
team_5 D A B
now i have a sample array of string IDs the value of which is: A B. I want to select the team/teams based on the maximum match of this data point with the database, for example, the result of the match should give me team_1, team_2 and team_5 as output. What is an efficient way to do this query on mysql? Thanks in Advance.
team 5not returned? is the match position aware?[B, A]array? What if it will be[A, B, D, F]array? I.e. what is your 'maximum match'?