From: Dmitry Y. <fir...@ya...> - 2007-07-11 18:13:02
|
Leyne, Sean wrote: > >> And tomorrow you will ask to use aliases in the WHERE clause and then >> elsewhere. I was always against this "feature". > > Why? > > It would seem to me to be a logical step. > > After all, defining an alias creates a 'virtual' field, why not be able > to refer to this field elsewhere in the SELECT statement? With this approach, we end with many queries becoming ambiguous, e.g.: CREATE TABLE T (A INT, B INT); SELECT A AS B FROM T WHERE B = 0; We're already affected by this issue in v2.0 for GROUP BY / ORDER BY, as we throw an error for queries that were perfectly valid before. And I don't want it to go further. IMO, those needing this feature should just express their wishes in code explicitly using a derived table with named derived fields. Dmitry |