I'm making a database query to a PostgreSQL server using Java and the corresponding JDBC driver.
The Query is:
select starttime, duration from callhistory3 where is_answ = 't' and callerid NOT IN ('PlayFile', 'anonymous') and NOT (char_length(callerid) = 3 AND char_length(dialednumber) = 3) ORDER BY starttime
Unfortunately the ResultSet is not sorted by starttime.
Example ResultSet:
2014-05-29 19:19:08,00:06:21.629
2014-05-29 19:52:19,00:00:02.71
2014-05-29 09:33:51,00:00:09.822
2014-05-29 10:38:52,00:00:03.026
2014-05-29 07:16:24,00:00:24.686
2014-05-29 07:35:58,00:00:55.013
If I use the same query in pgAdmin III, the result is sorted correctly.
Any idea how to get a sorted ResultSet without processing it in Java after the fact? Thanks.
starttime
? – a_horse_with_no_name Jun 4 at 21:53starttime
istimestamp without time zone
– punkrocker27ka Jun 6 at 18:37