How can I query rows where the output would be the rows with least null value on the columns?
My data is:
ID | col1 | col2 | col3 | col4
-----------+----------+-----------+-----------+-----------
1 | Null |Null | with value| with value
2 |with value|Null | with value| with value
3 |with value|Null | Null | Null
where the result would be:
ID | col1 | col2 | col3 | col4
-----------+----------+-----------+-----------+-----------
2 |with value|Null | with value| with value
Because id 2 is the record with fewest null values. Any help will be greatly appreciated. Thanks