Mysql
 sql >> Database >  >> RDS >> Mysql

come combinare e ordinare due tabelle diverse insieme in Mysql

Fondamentalmente, hai bisogno di union all :

select id, username, firstname, event_date
from ((select id, username, firstname, event_date
       from tablea
      ) union all
      (select id, username, NULL as firstname, event_date
       from tablea
      )
     ) t
order by event_date;