Skip to content
Advertisement

Omit rows where multiple columns contain NULL

I’m trying to figure out how to build a query that omits rows where both columns of interest are NULL. If only one or the other is NULL, then I would like to include that data.

In this example table, I would like to have a query that includes everything except row 3.

My thought would be to build a query as so:

This however omits any row where either Col1 or Col2 contains a NULL, yielding:

I want to include row 1 and 5.

If someone could point me in the right direction to form a WHERE clause that could perform such logic conditional to values across more than one column.

Thanks!

Advertisement

Answer

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement