Y
Yubasus
Hello,
I am hopping someone will help me with this.
I have three columns in my query LakeID, GR5, AREA. The LakeID is a number
that identifies a lake. Within that lake there are (GR5) 5 levels of chemical
substances that can be found going from 0 to 5. The AREA is identified as the
amount of total area that a certain chemical can be found in.
What I would like to do is query the data so that it gives me the GR5
rating going from the highest number of area that a GR5 covers to the lowest.
Also, I want the query to show what the percentage for each GR5 is of the
total area of the lake.
This is what I have so far.
SELECT adamhdwtrgeo.LAKE_ID, Sum(adamhdwtrgeo.AREA) AS SumOfAREA,
adamhdwtrgeo.GR5
FROM adamhdwtrgeo
GROUP BY adamhdwtrgeo.LAKE_ID, adamhdwtrgeo.GR5
ORDER BY adamhdwtrgeo.LAKE_ID, Sum(adamhdwtrgeo.AREA);
This is what was suggested.
SELECT a.id, a.gr5
SUM(a.x),
SUM(a.x) / (SELECT SUM(b.x)
FROM myTable As b
WHERE b.id=a.id )
FROM myTable As a
GROUP BY a.id, a.gr5
ORDER BY a.id, SUM(a.x)
When I try it gives me this error message:
Syntax error (missing operator) in query expression 'a.gr5 SUM (a.x)'.
Hope someone can help me figure out what is wrong.
I am hopping someone will help me with this.
I have three columns in my query LakeID, GR5, AREA. The LakeID is a number
that identifies a lake. Within that lake there are (GR5) 5 levels of chemical
substances that can be found going from 0 to 5. The AREA is identified as the
amount of total area that a certain chemical can be found in.
What I would like to do is query the data so that it gives me the GR5
rating going from the highest number of area that a GR5 covers to the lowest.
Also, I want the query to show what the percentage for each GR5 is of the
total area of the lake.
This is what I have so far.
SELECT adamhdwtrgeo.LAKE_ID, Sum(adamhdwtrgeo.AREA) AS SumOfAREA,
adamhdwtrgeo.GR5
FROM adamhdwtrgeo
GROUP BY adamhdwtrgeo.LAKE_ID, adamhdwtrgeo.GR5
ORDER BY adamhdwtrgeo.LAKE_ID, Sum(adamhdwtrgeo.AREA);
This is what was suggested.
SELECT a.id, a.gr5
SUM(a.x),
SUM(a.x) / (SELECT SUM(b.x)
FROM myTable As b
WHERE b.id=a.id )
FROM myTable As a
GROUP BY a.id, a.gr5
ORDER BY a.id, SUM(a.x)
When I try it gives me this error message:
Syntax error (missing operator) in query expression 'a.gr5 SUM (a.x)'.
Hope someone can help me figure out what is wrong.