nested aliases in select

2005-02-26 Thread David Smithson
Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The table has: contact_ident contact_firstname contact_lastname

nested aliases in select

2005-02-26 Thread David Smithson
Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The error returned is: ERROR 1064: You have an error in your

Re: nested aliases in select

2005-02-26 Thread Roger Baklund
David Smithson wrote: Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The error returned is: ERROR 1064: You have

Re: nested aliases in select

2005-02-26 Thread mos
At 04:11 PM 2/26/2005, David Smithson wrote: Hi all. Can somebody explain to me why the following SELECT doesn't work?: SELECT COUNT(DISTINCT(CONCAT(contact_firstname,' ',contact_lastname) as contact_name)) as count FROM Contacts GROUP BY contact_ident ORDER BY contact_name; The error returned