• 【TP3.2.3】根据字段统计条数


    //        省份查询
            $province = M('hospital') -> field('area as label,count(*) as value') -> group('area') -> select();

    输出结果如下所示:

    array(31) {
      [0] => array(2) {
        ["label"] => string(6) "上海"
        ["value"] => string(5) "25548"
      }
      [1] => array(2) {
        ["label"] => string(6) "云南"
        ["value"] => string(4) "6465"
      }
      [2] => array(2) {
        ["label"] => string(9) "内蒙古"
        ["value"] => string(4) "7610"
      }
      [3] => array(2) {
        ["label"] => string(6) "北京"
        ["value"] => string(5) "41644"
      }
      [4] => array(2) {
        ["label"] => string(6) "吉林"
        ["value"] => string(5) "12642"
      }
      [5] => array(2) {
        ["label"] => string(6) "四川"
        ["value"] => string(5) "27972"
      }
      [6] => array(2) {
        ["label"] => string(6) "天津"
        ["value"] => string(4) "9682"
      }
      [7] => array(2) {
        ["label"] => string(6) "宁夏"
        ["value"] => string(4) "5693"
      }
      [8] => array(2) {
        ["label"] => string(6) "安徽"
        ["value"] => string(5) "18968"
      }
      [9] => array(2) {
        ["label"] => string(6) "山东"
        ["value"] => string(5) "46775"
      }
      [10] => array(2) {
        ["label"] => string(6) "山西"
        ["value"] => string(5) "14149"
      }
      [11] => array(2) {
        ["label"] => string(6) "广东"
        ["value"] => string(5) "51940"
      }
      [12] => array(2) {
        ["label"] => string(6) "广西"
        ["value"] => string(4) "8223"
      }
      [13] => array(2) {
        ["label"] => string(6) "新疆"
        ["value"] => string(4) "4392"
      }
      [14] => array(2) {
        ["label"] => string(6) "江苏"
        ["value"] => string(5) "35832"
      }
      [15] => array(2) {
        ["label"] => string(6) "江西"
        ["value"] => string(5) "16371"
      }
      [16] => array(2) {
        ["label"] => string(6) "河北"
        ["value"] => string(5) "29154"
      }
      [17] => array(2) {
        ["label"] => string(6) "河南"
        ["value"] => string(5) "29559"
      }
      [18] => array(2) {
        ["label"] => string(6) "浙江"
        ["value"] => string(5) "31941"
      }
      [19] => array(2) {
        ["label"] => string(6) "海南"
        ["value"] => string(4) "2590"
      }
      [20] => array(2) {
        ["label"] => string(6) "湖北"
        ["value"] => string(5) "23529"
      }
      [21] => array(2) {
        ["label"] => string(6) "湖南"
        ["value"] => string(5) "19571"
      }
      [22] => array(2) {
        ["label"] => string(6) "甘肃"
        ["value"] => string(4) "5236"
      }
      [23] => array(2) {
        ["label"] => string(6) "福建"
        ["value"] => string(5) "16886"
      }
      [24] => array(2) {
        ["label"] => string(6) "西藏"
        ["value"] => string(3) "179"
      }
      [25] => array(2) {
        ["label"] => string(6) "贵州"
        ["value"] => string(4) "7445"
      }
      [26] => array(2) {
        ["label"] => string(6) "辽宁"
        ["value"] => string(5) "16988"
      }
      [27] => array(2) {
        ["label"] => string(6) "重庆"
        ["value"] => string(5) "11355"
      }
      [28] => array(2) {
        ["label"] => string(6) "陕西"
        ["value"] => string(5) "15026"
      }
      [29] => array(2) {
        ["label"] => string(6) "青海"
        ["value"] => string(3) "823"
      }
      [30] => array(2) {
        ["label"] => string(9) "黑龙江"
        ["value"] => string(5) "15140"
      }
    }
  • 相关阅读:
    今天开通我的博客
    在ArcGIS中,利用“行政单元面积权重法”实现人口数据格网化
    ArcGIS 下的水文分析
    常用计数器的verilog实现(binary、gray、onehot、LFSR、环形、扭环形)
    简单组合逻辑电路的verilog实现(包括三态门、38译码器、83优先编码器、8bit奇偶校验器)
    乘法器的verilog实现(并行、移位相加、查找表)
    简单时序逻辑电路的verilog实现,包括D触发器、JK触发器、锁存器、寄存器、
    简单ALU(算术逻辑单元)的verilog实现
    ubuntu下安装virtualbox 错误及解决办法
    C++单例模式对象的控制释放分析
  • 原文地址:https://www.cnblogs.com/BearLee/p/11413298.html
Copyright © 2020-2023  润新知