I have a problem with an inherited database for which the person who originally set it up left little documentation.
I have a set of users, each with three potential occupations. When queried, it returns values like these:
USER_ID CAREER_ID TITLE
1 44 Agricultural Engineer
1 136 Educational Psychologist
1 132 Clinical Psychologist
18 245 3D Designer
18 2 Accountant - Private Practice
18 1 Accountant - Industry and Commerce
19 245 3D Designer
19 2 Accountant - Private Practice
19 1 Accountant - Industry and Commerce
20 128 Advice Centre Worker
20 130 Careers Adviser
20 129 Care Assistant
21 1 Accountant - Industry and Commerce
21 245 3D Designer
21 2 Accountant - Private Practice
23 245 3D Designer
23 2 Accountant - Private Practice
23 1 Accountant - Industry and Commerce
29 245 3D Designer
29 2 Accountant - Private Practice
29 1 Accountant - Industry and Commerce
30 219 PC Games Tester
30 173 Bouncer
30 103 Stunt Person
32 245 3D Designer
27 2 Accountant - Private Practice
27 1 Accountant - Industry and Commerce
27 245 3D Designer
30 219 PC Games Tester
30 173 Bouncer
30 103 Stunt Person
As you can see, for some reason, careers 1, 2, and 245 are set as defaults. Now, I want to filter out the users that have that specific set of careers, but not all instances of them, as any user could have legitimately chosen one or two of the set.
I can live with filtering out the odd character who just might have actually chosen that particular set on purpose.
Hope someone can help. I’m sure the solution is rather simple, but I can’t come up with it.
Another solution:
The catch with the above solution is that it will exclude those that only have fewer than all three default careers. I.e., it will exclude users that only have (1,2), (1,245), (2,245), (1), (2), (245). If they must have all three and only those three, then you need to modify this solution like so: