Structure is:
CREATE TABLE stopsbuses (_id INTEGER PRIMARY KEY, stop_id NUMERIC, bus_id NUMERIC, drive TEXT, day TEXT);
CREATE TABLE stopsbusestimes (_id INTEGER PRIMARY KEY, sb_id NUMERIC, timeh NUMERIC, timem NUMERIC);
When I execute query like this:
SELECT timeh, timem FROM stopsbuses
INNER JOIN stopsbusestimes ON stopsbuses._id = stopsbusestimes.sb_id
WHERE stopsbuses.stop_id = 2 ORDER BY timeh asc, timem asc
Output for example is:
[..]
7 1
7 31
7 34
7 54
7 57
7 22
[..]
Same output is with simple:
SELECT timeh, timem FROM stopsbusestimes ORDER BY timeh, timem
Same output using php + pdo, SQLite Database Browser and in Android aplication.
Am i missing something in ordering by two columns?
In SQLite, all strings are sorted behind all numbers, so it’s likely that
22is not a number.To see the types, try
typeoforquote: