I have table where I have two columns briefeng
and briefbng
, I need the count of total null and not null values in a proper way:
Here is my sql code:
SELECT
Sum(If(brief_english Is Null, 1, 0)) AS briefeng,
Sum(If(brief_english Is NOT Null, 1, 0)) AS briefengnotnull,
Sum(If(brief_bangla Is Null, 1, 0)) AS briefbng
FROM synopsis;
but it returns a result like this way:
+----------+-----------------+----------+
| briefeng | briefengnotnull | briefbng |
+----------+-----------------+----------+
| 946 | 896 | 841 |
+----------+-----------------+----------+
But I need the result in this ways
+----------+--------------+
| status | total |
+----------+--------------+
| briefeng | 946 |
+----------+--------------+
| briefengnotnull | 896 |
+----------+--------------+
| briefengnotnull | 841 |
+----------+--------------+
How can I do that? I couldn't find a easy and efficient way.