600.null distinct.mql 338 B

123456789101112131415
  1. SELECT room.using_department AS "using_department" INTO /t0 FROM /hxyy/room room LIMIT 0, 20000;
  2. SELECT t0.using_department AS "部门",
  3. count(*) AS "房间数量",
  4. count(t0.using_department) AS "房间数量 空不计数"
  5. FROM /t0 t0 GROUP BY t0."using_department" order by "房间数量" desc LIMIT 0, 10
  6. /**
  7. output()
  8. **/
  9. ;