jimmythegeek
Programmer
I have done many group bys, and I think this is doable, but the depth is messing me up.
2 Tables:
RUN
---
SAMP_SITE_ID
RESULT
------
CON_ID
VALUE_RPTD
DEPTH
I want to find the maximum value reported for each sampling site/constituent combination. No problem when I group by the samp_site_id and con_id and do a max for the value_rptd. But I want the depth that belongs to that maximum value_rptd. I can't add the depth to the group by query because there are many depths and I will no longer be able to get the single maximum result for a samp_site_id/con_id combo. Hope this makes sense, and I am sure that others out there have had similar issues.
Thanks in advance for any help.
Jim Lunde
We all agree your theory is crazy, but is it crazy enough?
2 Tables:
RUN
---
SAMP_SITE_ID
RESULT
------
CON_ID
VALUE_RPTD
DEPTH
I want to find the maximum value reported for each sampling site/constituent combination. No problem when I group by the samp_site_id and con_id and do a max for the value_rptd. But I want the depth that belongs to that maximum value_rptd. I can't add the depth to the group by query because there are many depths and I will no longer be able to get the single maximum result for a samp_site_id/con_id combo. Hope this makes sense, and I am sure that others out there have had similar issues.
Thanks in advance for any help.
Jim Lunde
We all agree your theory is crazy, but is it crazy enough?