Prøv union:
SELECT table1.name, temperature, pressure
FROM table1 inner join table2 ON
table1.name = table2.name
UNION
SELECT table1.name, temperature, pressure
FROM table1 inner join table3 ON
table1.name = table3.name
Rediger:Du kan foretage et andet valg fra disse resultater, og derefter kan du begrænse, gruppere eller bestille:
SELECT * FROM
(
SELECT table1.name, temperature, pressure
FROM table1 inner join table2 ON
table1.name = table2.name
UNION
SELECT table1.name, temperature, pressure
FROM table1 inner join table3 ON
table1.name = table3.name
) as JoinedTable
LIMIT 0, 1
Rediger 2:For kun at have én række fra hver tabel (tabel 2 og tabel 3) kan du bruge limit/group by/order by for hver forespørgsel (forudsat at du har kolonnedato):
SELECT table1.name, temperature, pressure
FROM table1 inner join table2 ON
table1.name = table2.name
ORDER BY date DESC
LIMIT 0, 1
UNION
SELECT table1.name, temperature, pressure
FROM table1 inner join table3 ON
table1.name = table3.name
ORDER BY date DESC
LIMIT 0, 1