How to get data from 2 different tables with different fields?

for example 2 table
t1 (id_user, user_name)
t2 (id_article, description, content)
Through UINION ALL does not work - different number of columns.
April 7th 20 at 15:19
1 answer
April 7th 20 at 15:21
it is necessary to equalize the number of fields in the samples, for example
SELECT t1. id_user, t1.user_name, NULL,
FROM t1
UNION ALL
t2.id_article, t2.description, t2.content
FROM t2

some engines may require you to explicitly give the types in this case.
General search on the website when it is not specified what you are searching for (users or articles), the search goes through all the tables - Adrienne commented on April 7th 20 at 15:24

Find more questions by tags MySQL