I have two tables which i would like to turn into one in a SELECT query by merging some columns together while having other columns remaining distinct.
first table (posts_article)
id_post id_user title content published nbr_comments timestamp
---------------------------------------------------------------------------
1 15 title1 text1 1 23 1111111111
2 20 title2 text2 0 54 1122334455
second table (posts_text)
id_post id_user message nbr_comments timestamp
-------------------------------------------------------
1 17 message1 15 1234567891
2 22 message2 0 1987654321
expected result
id_post id_user title content message published nbr_comments timestamp
--------------------------------------------------------------------------------------
1 15 title1 text1 1 23 1111111111
2 20 title2 text2 0 54 1122334455
1 17 message1 15 1234567891
2 22 message2 0 1987654321
I've tried a few things but i can't really solve this. how can I get the expected result? What is the most efficient way to select that result?
EDIT: The logic of this merge is to be able to get all the different types of "posts" (submitted by users) at the same time.
Thanks.