3 Answers
3

-- For 3 highest gas prices
GASID IN (
SELECT TOP 3
GASID
FROM gasprices
GROUP BY GASID
ORDER BY AVG(Price) DESC)
-- For 3 lowest gas prices
GASID IN (
SELECT TOP 3
GASID
FROM gasprices
GROUP BY GASID
ORDER BY AVG(Price) ASC)

You are trying to select features by GASID and not by average price. There is a price field but no average price field. So, here, we select the top 3 GASID's where the average price is one of the top 3 or bottom 3 even though we cannot tell what that average price is in this query. You could obtain the average price by right clicking on the Price field and selecting the "Statistics" item.

I think any ArcGIS select statement is treated like a select * from where
And the where part is the window that your criteria is placed. So for your statement try something like this: SELECT top 3 * from WHERE IN ('item1', 'item2', etc.)
Use the apostrophe for text, and none for numbers.