I’m in the process of migrating remaining functionality of
Tripod.com from using Oracle to using MySQL. There were some
assumptions I had made about various data types, particularly
dates. One thing I discovered while converting one piece of code
is the Oracle function to_char(). I have a table:
SQL> select member_name, change_time from access_changes where member_name = 'phptester10' order by change_time desc;
MEMBER_NAME CHANGE_TI
-------------------- ---------
phptester10 13-APR-09
phptester10 13-APR-09
So, I thought “ok, this is just going to be a ‘date’ type with a
different format. For instance, 13-APR-09
will
become 2009-04-13
. But then I stumbled upon a query
in a piece of code that does a sort on dates from this
access_changes table:
SQL> select member_name, to_char(change_time, 'YYYY-MM-DD HH24:mi:SS') from access_changes where member_name = …
[Read more]