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:ssssss (the last is microseconds).
  Here are a possible examples of such timedeltas:

'0:00:06.229000'
'9:00:00.000000'
'10:01:23:041000'

I want to select the shortest duration (the smallest timedelta) using
the SQLite MIN(), like so:

SELECT MIN(duration) FROM Durations

Something like this perhaps:

select min(substr('0', 1, 15-length(duration)) || duration) from Durations;

--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to