1SELECT column_name(s)
2FROM table1
3INNER JOIN table2
4ON table1.column_name = table2.column_name;
1-- Rows with ID existing in both a, b and c
2-- JOIN is equivalent to INNER JOIN
3SELECT a.ID, a.NAME, b.VALUE1, c.VALUE1 FROM table1 a
4 JOIN table2 b ON a.ID = b.ID
5 JOIN table3 c ON a.ID = c.ID
6WHERE a.ID >= 1000;
7-- ⇓ Test it ⇓ (Fiddle source link)
1INNER JOIN is used when retrieving data from
2multiple tables and will return only matching data.
3
4example=
5Select P.FIRST_NAME , M.DRUG_ID
6FROM PATIENTS P
7INNER JOIN MEDICATIONS M ON P.PATIENTS_ID = M.PATIENTS_ID
1123SELECT columns FROM table_A INNER JOIN table_B ON join_conditionsXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1SELECT character.name, inventory.id
2FROM charactercreator_character AS character,
3charactercreator_character_inventory AS inventory
4WHERE character.character_id = inventory.character_id;