Skip to content Skip to sidebar Skip to footer

Sql Join Data From Multiple Tables With Mysql

I have multiple tables and the column fields and all match data type and column number wise, and all have a time field that also matches in the format of YYYY-MM-DD HH:MM:SS across

Solution 1:

try the following:

select x.time, a.value as value_tba, b.value as value_tbb, c.value as value_tbc from (select time from a union select time from b union select time from c) x left join a on x.time = a.time left join b on x.time = b.time left join c on x.time = c.time

Post a Comment for "Sql Join Data From Multiple Tables With Mysql"