I have two tables which each have a column named "date". I'd like to JOIN them but sort on that commonly formatted date column.
For example, here are my two tables:
Birthdays
+--------+---------+
| Date | Name |
+--------+---------+
| 03/10 | John |
+--------+---------+
| 09/24 | Sara |
+--------+---------+
Holidays
+--------+----------+
| Date | Title |
+--------+----------+
| 07/04 | July 4th |
+--------+----------+
| 12/25 | Xmas |
+--------+----------+
What I want to do is to JOIN them and ORDER BY the dates. The regular two-column sort wont work because if I don't specify which table's Date column I'm looking for it gives me an "ambiguous" error, and if I specify both with a common between them it will sort one and subsort the other.
Here is the output I want using that example data:
+--------+---------+----------+
| Date | Name | Title |
+--------+---------+----------+
| 03/10 | John | |
+--------+---------+----------+
| 09/24 | Sara | |
+--------+---------+----------+
| 07/04 | | July 4th |
+--------+---------+----------+
| 12/25 | | Xmas |
+--------+---------+----------+
Any advice on how to do this would be much appreciated, thanks!