Hi, Try :
SELECT a,COUNT(*) AS z FROM aa GROUP BY a HAVING z>1; Regards, Jocelyn ----- Original Message ----- From: "Rick Emery" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, January 18, 2002 10:30 PM Subject: Column Alias Bug?? > Is this a bug? I can't find an answer to this question in FAQs or archives. > > CREATE TABLE aa ( a int); > INSERT INTO aa VALUES (1),(2),(3),(2),(4),(5),(1),(6),(3); > > the following : > mysql> select a,count(*) as z from aa where z>1 group by a; > > displays this error: > ERROR 1054: Unknown column 'z' in 'where clause' > > Why isn't z recognized as a column identifier? > > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php