I want to get only rows having a value NULL
and some other value than NULL
for a particular username column.
If both rows have null for that particular username or both have some values other than null then it should not appear in output. If there are more than two rows for same username with null and some other value then they should appear.
Below is example sample and output. How it can be done using sql query?
+----------+-------+
| username | col2 |
+----------+-------+
| a | abc |
| a | ef |
| b | null |
| b | null |
| c | der |
| c | null |
+----------+-------+
output
+----------+------+
| username | col2 |
+----------+------+
| c | der |
| c | null |
+----------+------+
d, der
and 2 withd, null
?e, one
,e, two
and 2 or more withe, null
?