anonymous
2011-02-08 02:45:36 UTC
I am a complete stranger to SQL and hope you can help me solve this problem. I am supposed to get two tables in a specific manner. There is a table that is called qYears, another one is Countries.
qYears simply contains a list of years, thus looks like this
Year
------
2002
2003
2004
[...]
2011
Countries contains information about when a variable was researched in which country. It also contains a column named Years, however the range on that one is only 2002 - 2008. What I have to do now, is get the both together, so that in the query table it shows the years 2002 thru 2011, regardless of whether there is data for that year in the Countries table.
I have figured out, that I have to do something with outer joins here, my attempt looks like this:
SELECT qYear.Years, Countries.Geo
FROM qYear RIGHT JOIN Countries ON qYear.Years = Countries.Year
WHERE (((Countries.Geo)="AT" Or (Countries.Geo)="BE" Or (Countries.Geo)="DE" Or (Countries.Geo)="ES" Or (Countries.Geo)="FI" Or (Countries.Geo)="FR" Or (Countries.Geo)="IT" Or (Countries.Geo)="SE" Or (Countries.Geo)="UK"));
Sorry for the weird Syntax, I have to use MS Access, and that always screws with it.
So yeah, that is what I am trying to do. I have tried changing it from RIGHT to LEFT and back and forth, but the results do not differ whatsoever. The query only shows the years 2002 through 2008 with the corresponding data.
Thanks for helping me!