Re: [sqlite] MIN() for a timedelta?

2012-07-28 Thread C M
Thanks everyone for the various replies and help. Very useful and I will look into the differences and if I have questions about how these work will let you know. Thank you, Che ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] MIN() for a timedelta?

2012-07-27 Thread Bernd Lehmkuhl
Am 26.07.2012 23:32, schrieb C M: I have string representations of a Python timedelta stored in an SQLite database of the form H:MM:SS:ss (the last is microseconds). Here are a possible examples of such timedeltas: '0:00:06.229000' '9:00:00.00' '10:01:23:041000' I want to select the

Re: [sqlite] MIN() for a timedelta?

2012-07-27 Thread Rob Richardson
See below. -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Simon Slavin Sent: Thursday, July 26, 2012 8:47 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] MIN() for a timedelta? On 27 Jul 2012, at 12:04am

Re: [sqlite] MIN() for a timedelta?

2012-07-26 Thread Keith Medcalf
You could also store the timedelta as a float seconds as well. Then you wouldn't have to worry about inconsistent string formatting ... --- () ascii ribbon campaign against html e-mail /\ www.asciiribbon.org > -Original Message- > From: sqlite-users-boun...@sqlite.org

Re: [sqlite] MIN() for a timedelta?

2012-07-26 Thread Keith Medcalf
Select min(substr('0' || duration, -15)) from durations; --- () ascii ribbon campaign against html e-mail /\ www.asciiribbon.org > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of C M > Sent: Thursday, 26 July, 2012

Re: [sqlite] MIN() for a timedelta?

2012-07-26 Thread Igor Tandetnik
On 7/26/2012 5:32 PM, C M wrote: I have string representations of a Python timedelta stored in an SQLite database of the form H:MM:SS:ss (the last is microseconds). Here are a possible examples of such timedeltas: '0:00:06.229000' '9:00:00.00' '10:01:23:041000' I want to select the

Re: [sqlite] MIN() for a timedelta?

2012-07-26 Thread Simon Slavin
On 27 Jul 2012, at 12:04am, C M wrote: > On Thu, Jul 26, 2012 at 6:45 PM, Nico Williams wrote: >> >> >> Just use CASE to add the missing zero as necessary, something like this: >> >> SELECT strftime('%s', (SELECT CASE WHEN '9:12:32' LIKE '0%' THEN

Re: [sqlite] MIN() for a timedelta?

2012-07-26 Thread C M
On Thu, Jul 26, 2012 at 6:45 PM, Nico Williams wrote: > On Thu, Jul 26, 2012 at 4:32 PM, C M wrote: >> I could zero pad these strings myself, so that '9:00:00.00' >> becomes '09:00:00.00', but that would break other uses of these >> values in my

Re: [sqlite] MIN() for a timedelta?

2012-07-26 Thread Nico Williams
On Thu, Jul 26, 2012 at 4:32 PM, C M wrote: > I could zero pad these strings myself, so that '9:00:00.00' > becomes '09:00:00.00', but that would break other uses of these > values in my code and was wondering if there were a way in SQlite to > "see" these values as