I have a table of soccer match data, among many other columns I have columns containing the team Ids for the home team and the away team.
Often times I want to find all matches between two teams I need to construct a query that looks like
(`home_id` = X AND `away_id` = Y) OR (`home_id` = Y AND `away_id` = X)
This works fine, but ideally I could shorten this query and remove the OR and second and clause.
Is this something mySQL can handle, and is there a limit to the number of columns this can apply to?