var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: help with query
I'm trying to select the maximim value for certain zip codes, for example my table looks like this:
ZIP Category Value
90210 S1 5
90210 S2 10
90210 S3 2
90210 S4 3
10221 S1 24
10221 S2 3
And I want the end result to be each unique zip code with the category having the maximum value, for example 90210 S2, 10221 S1, etc
You need an internal key on that table, it will make life easier. You could try something like this in the mean time:
SELECT ZIP, Category
WHERE [Value] = MAX([Value])
GROUP BY ZIP
Or you could have a query that shows each zip code and its maximum value.
And then start another query based on joining the first query to the initial table joined on the zip code and max value fields.
The concept is called subqueries.