G
grhodes29
Table USERS
ID(PK) FNAME
1 Joe
2 Tom
3 Frank
4 John
Table OBSERATIONS
ID(PK) USERS_ID(FK) SCORE YEAR
1 2 345 2007
2 2 244 2008
3 2 232 2008
4 1 234 2007
5 1 233 2007
6 1 232 2008
7 1 345 2008
8 1 234 2009
9 3 123 2007
10 3 344 2009
11 4 123 2007
12 4 234 2008
13 4 234 2009
14 4 224 2009
I want to create a SELECT statement that relates these two tables together on
ID/USERS_ID and
I want only the USERS where they have related rows for 2007,2008 and 2009.
The users in the return set must have OBSERVATIONS for all three years.
My return set should be something like
ID FNAME
1 Joe
2 John
What is ths select syntax to use? I can't seemt to get in quite right. Thanks.
ID(PK) FNAME
1 Joe
2 Tom
3 Frank
4 John
Table OBSERATIONS
ID(PK) USERS_ID(FK) SCORE YEAR
1 2 345 2007
2 2 244 2008
3 2 232 2008
4 1 234 2007
5 1 233 2007
6 1 232 2008
7 1 345 2008
8 1 234 2009
9 3 123 2007
10 3 344 2009
11 4 123 2007
12 4 234 2008
13 4 234 2009
14 4 224 2009
I want to create a SELECT statement that relates these two tables together on
ID/USERS_ID and
I want only the USERS where they have related rows for 2007,2008 and 2009.
The users in the return set must have OBSERVATIONS for all three years.
My return set should be something like
ID FNAME
1 Joe
2 John
What is ths select syntax to use? I can't seemt to get in quite right. Thanks.