I have two tables:
Comments
--------
id
comment_content
time_stamp
Activities
-----------
id
activity_content
time_stamp
And I would like to combine the results from both, ordered by their timestamp fields.
MySQLselect
I have two tables:
Comments
--------
id
comment_content
time_stamp
Activities
-----------
id
activity_content
time_stamp
And I would like to combine the results from both, ordered by their timestamp fields.
Best Answer
Combine the two tables with
UNION
andORDER BY timestamp
. You can also add an addition (type
) column so the source of a row can be identified: