i have a table in mysql database. table 'sell_stats'
+-------------------+-----------+--------+
| id | max_price | sell_price| orders |
+-------------------+-----------+--------+
| 1 | 120 | 110 | 1 |
| 2 | 324 | 324 | 0 |
| 3 | 445 | 445 | 1 |
| 4 | 654 | 654 | 1 |
| 5 | 657 | 657 | 0 |
| 6 | 456 | 456 | 2 |
+-----------------+-------------+--------+
I want to find those columns in which max_price != sell_price
i wrote this query for that
select * from sell_stats where max_price != sell_price;
but i am getting the error
ERROR 1111 (HY000): Invalid use of group function.
then i tried grouping them on id, but still the same error.
select * from sell_stats where max_price != sell_price group by id;
please can anyone help me in this?