On Wed, Dec 07, 2005 at 10:32:20AM +0800, Christopher Kings-Lynne wrote:
> >MySQL 5.0.16 gives an error:
> >
> >mysql> SELECT EXTRACT (MICROSECOND FROM '2003-01-02 10:30:00.00123');
> >ERROR 1064 (42000): You have an error in your SQL syntax; check the manual
> >that corresponds to your MySQL server version for the right syntax to use
> >near 'FROM '2003-01-02 10:30:00.00123')' at line 1
>
> Odd, that example is straight from the MySQL 5 manual:
>
> http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html
Looks like MySQL doesn't allow a space before the open parenthesis
(there isn't one in the manual's example):
mysql> SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:00.00123');
+-------------------------------------------------------+
| EXTRACT(MICROSECOND FROM '2003-01-02 10:30:00.00123') |
+-------------------------------------------------------+
| 1230 |
+-------------------------------------------------------+
1 row in set (0.01 sec)
--
Michael Fuhr