原查询
select sum(case when age<=16 then 1 else 0 end ) age1,
sum(case when age>16 and age<=25 then 1 else 0 end ) age2,
sum(case when age>25 and age<=35 then 1 else 0 end ) age3,
sum(case when age>35 and age<=45 then 1 else 0 end ) age4,
sum(case when age>45 and age<=55 then 1 else 0 end ) age5,
sum(case when age>55 and age<=65 then 1 else 0 end ) age6,
sum(case when age>65 and age<=75 then 1 else 0 end ) age7,
sum(case when age>75 then 1 else 0 end ) age8,
count(id) other
from snap_face

经检查发现xml格式 <=号无法正确识别
改过之后的查询
select sum(case when age <=16 then 1 else 0 end ) age1,
sum(case when age>16 and age <=25 then 1 else 0 end ) age2,
sum(case when age>25 and age <=35 then 1 else 0 end ) age3,
sum(case when age>35 and age <=45 then 1 else 0 end ) age4,
sum(case when age>45 and age <=55 then 1 else 0 end ) age5,
sum(case when age>55 and age <=65 then 1 else 0 end ) age6,
sum(case when age>65 and age <=75 then 1 else 0 end ) age7,
sum(case when age>75 then 1 else 0 end ) age8,
count(id) other
from snap_face

  • 附:XML转义字符

<< 小于号;

>> 大于号;

& & 和 ;

' ‘’单引号;

" “” 双引号;

最新文章

  1. ios枚举规范
  2. B/S网站中IE6兼容问题
  3. 利用substring()方法,把一个表的不同分级所对应的字段名取出来。
  4. 弄清UTF8和Unicode
  5. Effective Java 10 Always override toString() method
  6. 放到u-boot/arch/arm/inlcude下面解压A20固件库制作笔记
  7. MySQL DELETE 表别名问题
  8. 【Delphi】圆角窗体
  9. [转载]C#时间函数
  10. tomcat内存溢出,改动设置
  11. 201521123072《java程序设计》第十二周学习总结
  12. Spring AOP分析(2) -- JdkDynamicAopProxy实现AOP
  13. Numpy入门 - 数组基本运算
  14. 会话机器人Chatbot的相关资料
  15. 如何接入银联“快速接入”产品API
  16. 发送http请求,get和post两种请求方式
  17. UE4随笔(一)准备过程
  18. am335x 10.1&quot;电容touch 不能识别
  19. [Virtualization] Virtualbox 转换磁盘格式(vboxmanage) disk to VMware
  20. 洛谷P2661 信息传递

热门文章

  1. 使用abcpdf分页设置的问题
  2. 调研一类软件的发展演变( 1000-2000 words, in Chinese)
  3. Axure环境安装,组件引入,使用示例
  4. 大数据与云计算的关系是什么,Hadoop又如何参与其中?Nosql在什么位置,与BI又有什么关系?
  5. SDL 开发实战(五): SDL 纹理渲染
  6. Hadoop伪分布式配置
  7. [Swift]LeetCode225. 用队列实现栈 | Implement Stack using Queues
  8. ubuntu 16.04 更改默认Python版本
  9. JSON 序列化的时候忽略无效的属性值
  10. 网络协议 9 - TCP协议(下):聪明反被聪明误