sql - COUNT CASE and WHEN statement in MySQL -


how use count case , when statement in mysql query, count when data null , when not null in 1 mysql query?

use:

select sum(case               when t.your_column null 1              else 0            end) numnull,        sum(case               when t.your_column not null 1              else 0            end) numnotnull   your_table t 

that sum column null & not null entire table. it's need group clause, depending on needs.


Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -