I have a table called Products with the schema (name, city, state, zip_code price).
And I want to find the most expensive products\' name for a given state\'s each zip_c
SELECT t.name, t.city, t.zip_code, t.price FROM ( SELECT zip_code , MAX(price) as price FROM products WHERE state = 'NJ' GROUP BY zip_code ) AS tm JOIN products as t ON tm.zip_code = t.zip_code AND tm.price = t.price WHERE t.state = 'NJ'