I'm trying to keep a row even when it is missing a value. But I just can't figure it out.
10.4.14-MariaDB
The example query:
SELECT
data.name,
am.value AS color
FROM
color_data cd
INNER JOIN color_data am
ON cd.value = am.id
INNER JOIN data
ON cd.id = data.id
WHERE
data.type = "vehicles"
AND data.slug LIKE "%something%"
AND cd.key = "color_id"
AND am.key = "color"
What I get:
----------------------
name | color |
----------------------
car | red
bicycle | blue
What I want:
----------------------
name | color |
----------------------
car | red
boat | <-- When this is empty keep the row.
bicycle | blue
SO when a color's ID is missing the row gets removed. I want to still keep that row. It's probably something fairly basic I'm missing.