Jay napisaÅ(a):
If only this worked in HAVING clauses ;) But i guess HAVING 1 = query_parameter would be to confusing for the engine ;/There is no way I know of to avoid doing this. I couldn't find one in Oracle either. You can refer to them by their number:
Select a, b, c FROM t Order by 1
is the same as:
Select a, b, c
FROM t
Order by a
OK - I'll probably go into declaring another alias name and/or repeating the whole expression. The whole thing is however confusing. Is that a bug? Shouldn't aliased names get some kind of prority when thay are being referred to in HAVING / ORDER BY query sections? AFAIR those two clauses are being resolved at the very end , after WHERE and JOINs handling, also all the result columns are already defined - so how come is there any ambiguity?
Either way - thanks for all your suggestions,
With all regards, -- Krzysztof Kotowicz

