Skip to content
Advertisement

SQL Finding multiple combinations in 2 tables (with all records)

I have two tables, one with some user configurations (#USERCONFIG) and the other (#COMBINATIONS), multiples combinations of configurations I need to find in the first table.

With this example data, I want the resultset to look like this:

Where it will return all users that have a match of configurations from the combinations table.

Any help would be appreciated.

Advertisement

Answer

The following will list users and the complete combinations they have. If it helps, you can think of it as the recipe-ingredient and user-ingredient textbook problem:

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement