I have two columns as below:
| Column A | Column B |
|---|---|
| A1 | NULL |
| A1 | A1 |
| B1 | C1. |
When I query these columns as below:
SELECT Column A, Column B
from table
where Column A != Column B
I am expecting the following result:
| Column A | Column B |
|---|---|
| A1 | NULL |
| B1. | C1 |
But my query is only giving me the second line of the expected result.
Consider below
select *
from your_table
where columnA is distinct from columnB
with output

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With