The number of fields in the tables is different. Doubles are possible in the second table (the first goes as a reference).
Table-1 mango fields
- date
- from_number
Table-2 email fields
- dateE,
- message.
The question is how to remove duplicates in the output (by the fields from_number and message ) and in the output so that you can filter / distinguish (where the data from which table in the field is displayed).
What I want to see is data from the second table without duplicates (taken from the resulting query) or data from the first table without duplicates (taken from the result query) or all together without duplicates. If you just take it through UNION
SELECT start, from_number FROM mango UNION SELECT DateE, Message FROM email then a common table with 2 first two fields appears and it is impossible to select values from the second table without duplicates in the output. I tried through LEFT JOIN
SELECT start, from_number, DateE, Message FROM mango LEFT JOIN email ON mango.from_number != email.Message but the result is generally delusional 7.5 million code entries in one table 1500 in another 4000 records. It may not be correct, as I think it is forming, and therefore ideas will never come to mind.