I would like to only include a comparison on an inner join if the value is not null. E.g. I am comparing addresses some addresses have the same house number street address and tag but have a distinct apartment number, but other addresses don't have apartment numbers associated with them so the value is null. These values don't get joined. 

A left outer join won't work because I need to join data associated with the values that have null apartment values. Any ideas? 

```
select * from address a
inner join ma_address ma
    on a.number=ma.number
    and a.street=ma.street
    and a.tag=ma.tag
    and a.apt=ma.apt

```

Thanks,