fix null handling in conjoined sql