I have a row in a table that contains the time of day in am / pm format, for example.
timeField --------- 9.00am 10.00pm 7.00am etc...
Is there a way in mysql to arrange these values?
You can do this using STR_TO_DATE in MySQL:
SELECT STR_TO_DATE('10.00pm','%h.%i%p');
try the following:
SELECT * FROM table_name ORDER BY STR_TO_DATE(timeField,'%h.%i%p');
To order it, you need to format a piece of date.
try it
SELECT COl1, COl2, DATE_FORMAT(yourdate, '%k:%i:%s') AS mydate FROM your_table ORDER BY mydate
Enjoy
SELECT * FROM table ORDER BY Name
This is all for me: Alphabet, Dates and Time
Source: https://habr.com/ru/post/1440506/More articles:Processing a large bitmap in android - androidHeroku H13 router errors logged in LogEntries - ruby-on-railsdefining a global structure pointer in C? - chttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1440504/springjstl-how-to-iterate-over-a-map-and-bind-input-fields-to-the-values&usg=ALkJrhivT1aDwuhmEnEAlS87giC2bjlW_gCollapsableTableView, UIViewControllerHierarchyInconsistency error in iOS6 - uikitHardware accelerated h264 decoding using ffmpeg, OpenCV - opencvJQuery - how can I get the value of a src video? - jqueryHow to pass input parameters to URL in BIRT? - eclipseIPython file path autocomplete - pythonHow to set up a framework using AudioUnit.framework on iOS - objective-cAll Articles