Adding an IF based comparison column I have a table which contains the following columns Table6
ID Place Name Money,

From this I am trying to create a table which contains the following column
Place ,Avg_Money_Place ,High_or_Low , the aim for high/low column is to show equal when this is avg of Place is equal to overall avg, low when it is lower than overall_avg and high elsewhere. 

I have a vague idea of how to calculate this with Where structures but am struggling to do with select structures. Here is my feeble attempt
I am struggling to this till now I have tried this 

Create table Table7 AS
   Select Distinct(Place) , Avg(Money)
     from Table6
    order by ID


This gives me the places and the corresponding averages but I am unable to get the hig/low column

I tried using the following function

INSERT INTO TABLE7 ( 
  Select High_Low
    CASE
      WHEN AVG(money) &lt; (select AVG(Money) from Table6 ) THEN 'LOW'
      WHEN AVG(money) &gt; (select AVG(Money) from Table6 ) THEN 'HIGH'
      WHEN AVG(money) = (select AVG(Money) from Table6 ) THEN 'EQUAL'
)


This did not work ! 
Please help
The query

SELECT Place, 
       AVG(Money)
FROM Table6
GROUP BY Place


gives us a place and average money for it.

The query

SELECT AVG(Money)
FROM Table6


gives us an average money over whole table. 

This 2 queries allows us to compare AVG for place and AVG for all (because there are more than 1 table we must add table alias to each field)

SELECT t6.Place, 
       AVG(t6.Money) avg_place,
       CASE WHEN AVG(t6.Money) &gt; subquery.avg_all THEN 'High'
            WHEN AVG(t6.Money) &lt; subquery.avg_all THEN 'Low'
            ELSE                                       'Equal' 
       END avg_rank
FROM Table6 t6, ( SELECT AVG(t6_1.Money) avg_all
                  FROM Table6 t6_1 ) subquery
GROUP BY t6.Place


And now we can to store the result in new table

CREATE TABLE Table7
AS
SELECT t6.Place, 
       AVG(t6.Money) avg_place,
       CASE WHEN AVG(t6.Money) &gt; subquery.avg_all THEN 'High'
            WHEN AVG(t6.Money) &lt; subquery.avg_all THEN 'Low'
            ELSE                                       'Equal' 
       END avg_rank
FROM Table6 t6, ( SELECT AVG(t6_1.Money) avg_all
                  FROM Table6 t6_1 ) subquery
GROUP BY t6.Place