I am merging two tables, each one with different events data. Each table has a date for the events.
How do I combine these events to sort them seamlessly by date?
SELECT
t1.eventName,
t1.eventTime,
t2.evntName,
t2.evntTime
FROM t1
LEFT JOIN t2 ON (t1.eventID = t2.eventID)
ORDER BY ??? DESC
LIMIT 10
@Gonzalo is close but not quite there. You need to put each table into subqueries and alias each column you want in the final result. If one table doesn’t have a column that you need from another use a literal and alias it.
Put any
WHEREclauses inside the subqueries.