I have read multiple articles and now I am confused between 2 following statements.
- If we use having without group by then whole table act as Single Group.
- If we use having without group by then each table act as an individual Group.
Which One is Correct in MySQL? For example I have a table named ABC as Follow:
| Wage |
_____________
| 4 |
| 8 |
| 28 |
| 90 |
If We Use Following Query
select wage
from ABC
having wage > 1
then all the records get printed. So each row works as indivisual group.
But If We Use:
select wage
from ABC
having wage = max(wage)
the no record get printed. So whole table works as a group.
So which one is correct and why this 2 queries shows different results.