I have a many to many relationship between some Jobs and some Workers.
Each worker has a property like age. I want to get all the Jobs and Workers that collaborate with the workers of age 22 (for example), including the workers of age 22.
For example if A and B are two workers who do the Job X and one of them is 22 years old, I want a query to return both A and B (joined with the X and its properties)
I have three tables:
Job
1 JobI
2 JobII
Workers:
A Smith 22
B John 21
C Jack 23
J-W relation
1 A
1 B
2 B
2 C
In this example I want A and B info and Job I because A is 22 years old and collaborate with B in Job I
Something like
Ie get all the jobs with a 22 year old worker, then join back to jobs and workers to get the details.
Any 22 year old with more than one job will repeat as will any job with more than one 2 year old worker though.