4 ms·
The problem with that order is that where often depends on what has been selected. If you select max(a) as ma, you should know that before you try to compare it
by kedean 10y ago
The problem with that order is that where often depends on what has been selected. If you select max(a) as ma, you should know that before you try to compare it to something.
- combatentropy 10y agoThis doesn't work, at least in PostgreSQL: select b, max(a) as ma from t group by b where ma > 100 ERROR: column "ma" does not exist You would have to use the having clause: select b from t group by b having max(a) > 100