我有以下 SQL 语句。我想做的是包含一个 IF 语句,以涵盖其中一列返回 0 或空白结果的可能性,没有 0 ID。在这种情况下,我试图涵盖magez_cfv_nations
结果可能返回零或空白结果的可能性。
SELECT c.clan_name, n.nation_name,
CONCAT(r.rarity_shorthand, " - ", r.rarity_name) AS rarity_text,
t.trigger_name, s.skill_name
FROM `magez_cfv_cards` AS cards
JOIN `magez_cfv_clans` c ON cards.clan_id = c.clan_id
JOIN `magez_cfv_nations` n ON cards.nation_id = n.nation_id
JOIN `magez_cfv_rarity` r ON cards.rarity_id = r.rarity_id
JOIN `magez_cfv_trigger` t ON cards.trigger_id = t.trigger_id
JOIN `magez_cfv_skills` s ON cards.skill_id = s.skill_id