List:General Discussion« Previous MessageNext Message »
From:Egor Egorov Date:April 2 2003 4:06pm
Subject:re: How come I can't use an "AS" field in other operations?
View as plain text  
On Wednesday 02 April 2003 04:04, Daevid Vincent wrote:
> Is this a bug or just not implemented in 3.23.56-Max?
>
> mysql> SELECT alarm_notes, DATE_FORMAT(alarm_date,'%m/%d/%y %h:%i %p') AS
> alarm_date_format, IFNULL(CONCAT(contact_fname, ' ', alarm_date),
> alarm_date_format) AS contact_name, contact_email, contact_phone FROM
> alarm_table LEFT JOIN contact_table ON alarm_contact_table_id = contact_id
> WHERE alarm_rep_table_id = '1' ORDER BY alarm_date;
> ERROR 1054: Unknown column 'alarm_date_format' in 'field list'

[skip]

It's not a bug. You can't reference column aliases in the select list. 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   Egor.Egorov@stripped
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com



Thread
How come I can't use an "AS" field in other operations?Daevid Vincent2 Apr
  • re: How come I can't use an "AS" field in other operations?Egor Egorov2 Apr
    • re: How come I can't use an "AS" field in other operations?Daevid Vincent2 Apr
      • re: re: How come I can't use an "AS" field in other operations?Egor Egorov3 Apr