How can I select any row that contains empty or null column?
I'm trying to run a check on my table, in which I want to see if any of my rows contain a column that doesn't hold a value..
example table: demo
+----+------+------+
| ID | col1 | col2 |
+----+------+------+
| 1 | VAL1 | Val2 |
| 2 | NULL | Val2 |
| 3 | VAL1 | NULL |
+----+------+------+
I want the query to return rows 2-3 , noting that I have many columns in actual table so I don't want to include it in the query with 'where or'.
can it be done with mysql?
select * from tablename where col1 is NULL or col2 is NULL
Result
ID | col1 | col2
------------------
2 | NULL | Val2
3 | VAL1 | NULL
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