1. count ```sql / 统计男性人数 / select count(sex=’男’ or null) from user

    / 统计班级不为空 的所有男生 / select count(if(!isnull(class_uuid) and sex=’男’,’true’,’false’)=true or null)

    1. 2. isnull( )
    2. ```sql
    3. select isnull(user_uuid) from user
    select (isnull(user_uuid),'1') from user
    
    1. if

      /*
      格式: if(boolean,str1,str2)
      */
      /*
      搭配isnull使用
      如果 user_uuid为空 , 那么当前返回 0
      否则返回user_uuid 本身
      */
      select if(isnull(user_uuid),0,user_uuid) from user