Christopher Kings-Lynne wrote:
Why aren't 'minutes' considered too? Because they aren't 'seconds'.
Well, seconds aren't microseconds either.
Yeah, they are: it's just one field. The other way of looking at it
(that everything is seconds) is served by "extract(epoch)".
Well, it's differ
In article <[EMAIL PROTECTED]>,
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
mysql> SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123');
>> +---+
>> | EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123') |
>> +---
mysql> SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123');
+---+
| EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123') |
+---+
| 1230
On Wed, Dec 07, 2005 at 10:47:45AM +0800, Christopher Kings-Lynne wrote:
> Ok, and what does this give:
>
> SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123');
mysql> SELECT EXTRACT(MICROSECOND FROM '2003-01-02 10:30:01.00123');
+---+
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 serve
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') |
+-
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
On Wed, Dec 07, 2005 at 09:43:30AM +0800, Christopher Kings-Lynne wrote:
> >>Why aren't 'minutes' considered too? Because they aren't 'seconds'.
> >>Well, seconds aren't microseconds either.
> >
> >Yeah, they are: it's just one field. The other way of looking at it
> >(that everything is seconds
Why aren't 'minutes' considered too? Because they aren't 'seconds'.
Well, seconds aren't microseconds either.
Yeah, they are: it's just one field. The other way of looking at it
(that everything is seconds) is served by "extract(epoch)".
Well, it's different in MySQL unfortunately - what doe
Bruce Momjian writes:
> Why aren't 'minutes' considered too? Because they aren't 'seconds'.
> Well, seconds aren't microseconds either.
Yeah, they are: it's just one field. The other way of looking at it
(that everything is seconds) is served by "extract(epoch)".
regar
Tom Lane wrote:
> Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> > OK, AndrewSN just pointed out that it's "documented" to work like that...
> > ...still seems bizarre...
>
> It seems reasonably consistent to me. extract() doesn't consider
> seconds and fractional seconds to be distinct fi
Christopher Kings-Lynne <[EMAIL PROTECTED]> writes:
> OK, AndrewSN just pointed out that it's "documented" to work like that...
> ...still seems bizarre...
It seems reasonably consistent to me. extract() doesn't consider
seconds and fractional seconds to be distinct fields: it's all one
value. T
Christopher Kings-Lynne wrote:
> OK, AndrewSN just pointed out that it's "documented" to work like that...
>
> ...still seems bizarre...
So it's a "gotcha"!
--
Alvaro Herrerahttp://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x
OK, AndrewSN just pointed out that it's "documented" to work like that...
...still seems bizarre...
Chris
Christopher Kings-Lynne wrote:
Does anyone else find this odd:
mysql=# select extract(microseconds from timestamp '2005-01-01
00:00:00.123');
date_part
---
123000
(1 row)
my
Does anyone else find this odd:
mysql=# select extract(microseconds from timestamp '2005-01-01
00:00:00.123');
date_part
---
123000
(1 row)
mysql=# select extract(microseconds from timestamp '2005-01-01
00:00:01.123');
date_part
---
1123000
(1 row)
No other extracts inc
15 matches
Mail list logo