select
race_id,
horse_id,
horse_wins,
jockey_id,
jockey_wins,
NVL(horse_wins, 0) + NVL(jockey_wins, 0) wins
from
proj_entry a
FULL JOIN
tot_h_wins b
ON
a.horse_id = b.horse
FULL JOIN
tot_j_wins c
ON
a.jockey_id = c.jockey
where
race_id = 1
You don't use the NVL in your where
clause when you want to change how a value is displayed. Where
is for filtering returned rows. If you want to change how it's displayed, use it in the select
clause.