I need help with the following query in MySQL, I have 3 tables:
app :
+--------------+-----------+
| id_app (PK) | name |
+--------------+-----------+
| 1 | Facebook |
| 2 | Instagram |
+--------------+-----------+
lang :
+--------------+-----------+
| id_lang (PK) | value |
+--------------+-----------+
| 1 | English |
| 2 | Español |
+--------------+-----------+
app_lang :
+--------------+-------------+
| id_app (PK) | id_lang (PK) |
+--------------+-------------+
| 1 | 1 |
| 2 | 1 |
+--------------+-------------+
What I want is that when I review the app (I have the id_app
) it brings me all the languages even if they are not associated in the app_lang table to the id_app
corresponding one
Result :
+----------+----------------------+---------+
| id_app | id_lang | name | value |
+----------+---------+------------+---------+
| 1 | 1 | Facebook | English |
| NULL | 2 | NULL | Español |
+---------+----------+------------+---------+
You just have to use
LEFT JOIN
: