I am trying to write a query on a column in a table. In column "text" I can have values of either 5 or 10 or null. I want to get count of number of rows in the table for 5 or 10 or null. I wrote following query it is not working properly
select COUNT(*) from t_test
select COUNT(text) from t_test where text=5
select COUNT(text) from t_test where text=10
select COUNT(text) from t_test where text=null
I can get first three select statements values but the last one with null returns zero while there are rows with null in it. How to write this query? Thanks