When I use
Select Distinct Brand_ID
from db.ABC
WHERE
Brand_ID <> 800
I get the returned output:
+----------+
| Brand_ID |
+----------+
| 100 |
| 200 |
| 300 |
| 400 |
| 500 |
| 600 |
| 700 |
| 900 |
+----------+
However, the column does contain NULL Values, which are present. I need to update my select statement to explicitly say:
Select Distinct Brand_ID
from db.ABC
WHERE
Brand_ID <> 800 OR Brand_ID IS NULL
To get the correct output:
+----------+
| Brand_ID |
+----------+
| NULL |
| 100 |
| 200 |
| 300 |
| 400 |
| 500 |
| 600 |
| 700 |
| 900 |
+----------+
Why does the NULL
value get removed when not explicitly stated?