The main issue I am having is that when I join two tables, the join column may be null in one or both of the join columns. I've been trying to write a query to exclude the nulls, but since they are in the columns to join, nothing seems to work.
The query is like this:
SELECT
a.name_id,
a.name,
a.t_fed_id,
v.std_id_num,
v.vendor_id
FROM name_address a
JOIN vendor v
ON a.t_fed_id = v.std_id_num
No matter what I've tried, I still get results like this where both columns are null.

Things I've tried,
- INNER JOIN
- LEFT JOIN
- WHERE t_fed_id is null AND std_id_num is null
- WHERE t_fed_id is null || std_id_num is null
- CASE WHEN t_fed_id is null then t_fed_id …. etc
- WHERE EXISTS (SELECT t_fed_id FROM name_address WHERE t_fed_id is not null)
- WHERE COALESCE(t_fed_id, std_id_num) is not null
- SELECT …. FROM name_address a, vendor v WHERE t_fed_id = std_id_num AND t_fed_id is not null (instead of JOIN)
- other variations of the above
Can anyone give me a suggestion that will work please? I can't think of anything else to try.
Thanks