Check the docs to see when count distinct() was added.
It is not in my 3.22.24, but is in my 3.23

Web Depressed wrote:
> 
> Hi,
> Woh ! This is very strange.  Any ideas ?
> 
> mysql> SELECT * FROM Table2;
> +------------+-------------+-----------+
> | date       | no_of_items | table1_id |
> +------------+-------------+-----------+
> | 2001-02-04 |           3 |         1 |
> | 2001-02-05 |           2 |         1 |
> | 2001-02-06 |           2 |         1 |
> | 2001-02-04 |           2 |         2 |
> | 2001-02-06 |           1 |         2 |
> +------------+-------------+-----------+
> 5 rows in set (0.04 sec)
> 
> mysql> SELECT COUNT(date) FROM Table2;
> +-------------+
> | COUNT(date) |
> +-------------+
> |           5 |
> +-------------+
> 1 row in set (0.02 sec)
> 
> mysql> SELECT DISTINCT date FROM Table2;
> +------------+
> | date       |
> +------------+
> | 2001-02-04 |
> | 2001-02-05 |
> | 2001-02-06 |
> +------------+
> 3 rows in set (0.03 sec)
> 
> mysql> SELECT COUNT(DISTINCT date) FROM Table2;
> ERROR 1064: You have an error in your SQL syntax near
> 'DISTINCT date) FROM Table2' at line 1
> mysql> SELECT COUNT (DISTINCT date) FROM Table2;
> ERROR 1064: You have an error in your SQL syntax near
> '(DISTINCT date) FROM Table2' at line 1
> mysql> SELECT COUNT(DISTINCT 'date') FROM Table2;
> ERROR 1064: You have an error in your SQL syntax near
> 'DISTINCT 'date') FROM Table2' at line 1
> 
> FYI:
> ./mysql  Ver 9.38 Distrib 3.22.32, for sun-solaris2.7
> (sparc)
> 
> Kind Regards,
> -- Frank
>

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