3 ms·
I have thought the same thing, because it would match the order of other statements (insert, update, and delete) which begin with the source. In fact I would p
by combatentropy 10y ago
I have thought the same thing, because it would match the order of other statements (insert, update, and delete) which begin with the source.
In fact I would put the select after the where clause:
from t
where x = 'y'
select a, b, c
order by a, b, c
- kedean 10y agoThe 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