S
steve
Hello,
I dont know wether I have spreadsheet-ditis but I just can`t figure out a
way to do the following:
- Two tables , linked via a StationID.
One tblAQMeasurements has air-quality measurements for various pollutants
(ozone, mercury , etc.)
datetime | StationID | PolutantCode | value
where value is the measurement.
The other table is similar , but for meteorological data, not pollutants.
Like Temperature, humidity etc.
tblMetMeasurements
datetime | StationID | ParameterCode | value
Now , I want to construct a querry in SQL (TSQL or Access is not important,
I will figure out the syntactical details) that will extract *on the same
rows* information about more that one pollutants and/or more than one
parameters (of course for the same station). The only, "linking" variable
will be the datetime.
For example:
datetime - Temperature measurement - Ozone measurement - Mercury measurement
remember the first is a Meteorological parameter (tblMetMeasurement) the
other two pollutants (tblAQMeasurements).
The reason for this is to eventually extract to Excel or something and do
statistics. Is there a way to do this?
I have a feeling the answer will be either too obvious (embarassing) OR
no-way. Am I missing completely the idea of relational databases ?
I dont want a Union, i.e. have the data "in series". I want them "next to
each other".
For a specific station there are a few pollutants (PollutantCode) and a few
meteorological parameters (ParameterCode) along with their hourly
measurements.
BTW, I think the design is fine, the tables are not directly related by
SationID but indirectly. What i show here is a small example for you to
understand. If it can be done here it can be done in my case.
Before you ask: There are *NO* guarantees that I *will* have data for all
three parameters-pollutants on the *same* datetime ! In this case I just
dont display them. Do not assumme that i have all measurements for a
specific period of time.
TIA for any help/suggestions
-steve
I dont know wether I have spreadsheet-ditis but I just can`t figure out a
way to do the following:
- Two tables , linked via a StationID.
One tblAQMeasurements has air-quality measurements for various pollutants
(ozone, mercury , etc.)
datetime | StationID | PolutantCode | value
where value is the measurement.
The other table is similar , but for meteorological data, not pollutants.
Like Temperature, humidity etc.
tblMetMeasurements
datetime | StationID | ParameterCode | value
Now , I want to construct a querry in SQL (TSQL or Access is not important,
I will figure out the syntactical details) that will extract *on the same
rows* information about more that one pollutants and/or more than one
parameters (of course for the same station). The only, "linking" variable
will be the datetime.
For example:
datetime - Temperature measurement - Ozone measurement - Mercury measurement
remember the first is a Meteorological parameter (tblMetMeasurement) the
other two pollutants (tblAQMeasurements).
The reason for this is to eventually extract to Excel or something and do
statistics. Is there a way to do this?
I have a feeling the answer will be either too obvious (embarassing) OR
no-way. Am I missing completely the idea of relational databases ?
I dont want a Union, i.e. have the data "in series". I want them "next to
each other".
For a specific station there are a few pollutants (PollutantCode) and a few
meteorological parameters (ParameterCode) along with their hourly
measurements.
BTW, I think the design is fine, the tables are not directly related by
SationID but indirectly. What i show here is a small example for you to
understand. If it can be done here it can be done in my case.
Before you ask: There are *NO* guarantees that I *will* have data for all
three parameters-pollutants on the *same* datetime ! In this case I just
dont display them. Do not assumme that i have all measurements for a
specific period of time.
TIA for any help/suggestions
-steve