Jointure de données dans SQL
Maham Faisal Khan
Senior Content Developer, DataCamp
SELECT * FROM left_table INNER JOIN right_table ON left_table.id = right_table.idINNER JOIN another_table ON left_table.id = another_table.id;
Remarque : selon le cas d’utilisation, il est possible d’utiliser left_table ou right_table dans la clause ON.

SELECT p1.country, p1.continent,
president, prime_minister
FROM prime_ministers as p1
INNER JOIN presidents as p2
USING(country);
| country | continent | president | prime_minister |
| -------- | ------------- | ----------------------- | ---------------- |
| Egypt | Africa | Abdel Fattah el-Sisi | Mostafa Madbouly |
| Portugal | Europe | Marcelo Rebelo de Sousa | Luís Montenegro |
| Pakistan | Asia | Asif Ali Zardari | Shehbaz Sharif |
| India | Asia | Droupadi Murmu | Narendra Modi |

-- SQL query for chaining inner joins SELECT p1.country, p1.continent, president, prime_minister, pm_start FROM prime_ministers as p1 INNER JOIN presidents as p2 USING(country)INNER JOIN prime_minister_terms as p3 USING(prime_minister);
SELECT *
FROM left_table
INNER JOIN right_table
ON left_table.id = right_table.id;

SELECT *
FROM left_table
INNER JOIN right_table
ON left_table.id = right_table.id
AND left_table.date = right_table.date;

Jointure de données dans SQL