At 09:47 AM 3/20/2001 +0100, \"Piotr Gapinski\" wrote:

>small problems with query below...
>my fault?
>
>mysql> desc poll_answer;
>+---------+-------------+------+-----+---------+-------+
>| Field   | Type        |Null  | Key | Default | Extra |
>+---------+-------------+------+-----+---------+-------+
>| poll_id | int(10)     |      |     | 0       |       |
>| cnt     | int(10)     |      |     | 0       |       |
>| answer  | varchar(60) |      |     |         |       |
>+---------+-------------+------+-----+---------+-------+
>  3 rows in set (0.00 sec)
>
>mysql> select answer from poll_answer having cnt=1;
>ERROR 1054: Unknown column 'cnt' in 'having clause'

try:

mysql> select answer, count(*) as cnt from poll_answer group by answer 
having cnt=1;


-bill


---------------------------------------------------------------------
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

Reply via email to