How can I locate multiple mysql tables in which the content is sorted by the last update time mysql & nbsp; how can I locate multiple tables in which the content is sorted by the last update time and the fields are the same, only tables with different content names: aaa, bbb, ccc, ddd & nbsp; four table fields: title, classid, userid, newstime, how can I locate multiple tables in class mysql and arrange the content according to the last update time?
How can I locate multiple mysql tables and arrange the content according to the last update time?
The four fields are the same, and only the content is different.
Table name: aaa, bbb, ccc, and ddd
Table fields: title, classid, userid, newstime, classname, images
I want to check the descending order of the last update (newstime) of four independent tables without any association, and how to write the 10 records with userid = 2?
Unix timestamp format of newstime field
The userid field is the field of the user ID (that is, to find out the last updated content of this user in ten descending chronological order:
------ Solution --------------------
select a.* from aaa as a union all select b.* from bbb as b union all select c.* from ccc as c union all select d.* from ddd as d where userid = 2 orderby newstime desc limit 10
------ Solution --------------------
Upstairs.