Unix Technical Forum

strange result in query...

This is a discussion on strange result in query... within the MySQL forums, part of the Database Server Software category; --> > mysql> SELECT risoluzione, inizio, timediff(risoluzione,inizio) AS delta > -> FROM statistiche > -> WHERE risoluzione IS NOT NULL ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #11 (permalink)  
Old 02-28-2008, 09:45 AM
Giovanni
 
Posts: n/a
Default Re: strange result in query...

> mysql> SELECT risoluzione, inizio, timediff(risoluzione,inizio) AS delta
> -> FROM statistiche
> -> WHERE risoluzione IS NOT NULL
> -> ORDER BY TIME_TO_SEC(delta) ASC;
> +---------------------+---------------------+-----------+
> | risoluzione | inizio | delta |
> +---------------------+---------------------+-----------+
> | 2007-04-29 15:16:55 | 2007-04-29 15:15:55 | 00:01:00 |
> | 2007-05-02 23:25:04 | 2007-05-02 23:23:57 | 00:01:07 |
> | 2007-05-05 20:28:21 | 2007-05-05 20:26:12 | 00:02:09 |
> | 2007-05-05 10:21:08 | 2007-05-05 10:18:47 | 00:02:21 |
> | 2007-04-30 16:52:50 | 2007-04-30 16:45:37 | 00:07:13 |
> | 2007-05-05 14:23:42 | 2007-05-05 13:40:07 | 00:43:35 |
> | 2007-04-29 23:58:17 | 2007-04-29 22:26:36 | 01:31:41 |
> | 2007-05-04 12:07:43 | 2007-05-01 08:58:28 | 75:09:15 |
> | 2007-05-04 23:43:53 | 2007-05-01 14:11:14 | 81:32:39 |
> | 2007-05-05 16:35:21 | 2007-04-30 21:10:16 | 115:25:05 |
> | 2007-05-04 23:43:53 | 1980-05-04 00:43:53 | 838:59:59 |
> | 2007-05-04 23:43:53 | 0001-05-04 00:43:53 | 838:59:59 |
> +---------------------+---------------------+-----------+
> 12 rows in set, 4 warnings (0.00 sec)
>
> But you might have noted that the TIMEDIFF function shows only values up to
> 838:59:59 which represent a time difference of almost 34 days and 23 hours.
> Which is a much smaller time difference then the 2000 years I used to test
> the query.


Hell! It's really strange... are 3020400 seconds...
mmm.... with datediff should be ok...but I don't know if it works with
my query...
however i cannot explain to myself, why it order by clause works in
alphanumeric mode
with datetime type...
Does exists datetimediff?
I cannot try it now... i've not a console

tnx you all for help, guys!

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com