mardi 4 août 2015

Android SQLite Query, order by time

My time is sent to the database as a string e.g.

8:00 AM
9:00 AM
12:50 PM

I want to retrieve them from the database in the order of time. Researched another question and I realised it could be done in MySQL like so:

SELECT * 
FROM table_name 
ORDER BY STR_TO_DATE(timeField,'%h.%i%p');

Is there a way I can do it the same way in SQLite? Tried the codes above and logcat states there is no such function.

Aucun commentaire:

Enregistrer un commentaire