America 20-07-19 am 12:47
Korea 20-07-19 am 03:04
Japan 20-07-19 am 10:20
Canada 20-07-19 pm 12:03
Germany 20-07-19 pm 05:35
France 20-07-19 pm 10:44
China 20-07-19 pm 11:20
I have a table like the above.
code1
SELECT country, dateTime FROM test ORDER BY country
The code1 above produces the result1 below.
result1
America 20-07-19 am 12:47
Canada 20-07-19 pm 12:03
China 20-07-19 pm 11:20
France 20-07-19 pm 10:44
Germany 20-07-19 pm 05:35
Japan 20-07-19 am 10:20
Korea 20-07-19 am 03:04
code2
SELECT country, dateTime FROM test ORDER BY dateTime
And the code2 above produces the result2 below.
result2
Korea 20-07-19 am 03:04
Japan 20-07-19 am 10:20
America 20-07-19 am 12:47
Germany 20-07-19 pm 05:35
France 20-07-19 pm 10:44
China 20-07-19 pm 11:20
Canada 20-07-19 pm 12:03
Since 12 means 00 in hour, I like to make the target result below with "ORDER BY dateTime.
target result
America 20-07-19 am 12:47
Korea 20-07-19 am 03:04
Japan 20-07-19 am 10:20
Canada 20-07-19 pm 12:03
Germany 20-07-19 pm 05:35
France 20-07-19 pm 10:44
China 20-07-19 pm 11:20