mysql中 GROUP_CONCAT函数用法
来源:互联网 发布:淘宝宝贝发布物流 编辑:程序博客网 时间:2024/05/29 09:59
GROUP_CONCAT函数返回一个字符串结果,该结果由分组中的值连接组合而成。一般离不开CONCAT()函数
CONCAT(str1,str2,…)
返回结果为连接参数产生的字符串。如有任何一个参数为NULL ,则返回值为 NULL。
group_concat([DISTINCT] 要连接的字段 [Order BY ASC/DESC 排序字段] [Separator '分隔符'])
mysql中group by 之后sum求和,又要展示具体数据,sql如下:
SELECT*, GROUP_CONCAT(CONCAT(caption, ':', convert(s_amount/100,decimal(18,2))) SEPARATOR ',') AS money_details,convert(SUM(s_amount)/100,decimal(18,2)) AS sum_amountFROM(SELECTct.contract_id,ct.caption,SUM(cd.amount) AS s_amountFROMcontract_account_term ctINNER JOIN contract_account_details cd ON ct.id = cd.account_term_id
阅读全文
0 0
- mysql中 GROUP_CONCAT函数用法
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中group_concat函数
- MySQL中concat函数,concat_ws,group_concat,repeat() 函数用法
- MySQL中函数CONCAT及GROUP_CONCAT的用法
- mysql中GROUP_CONCAT()函数的含义及用法
- Myeclipse出现Could not create the view: An unexpected exception was thrown.的问题
- 缩放动画源码分析
- 你也可以找到好工作(一)
- EasyTouch
- JS 类型判断 的3种方式
- mysql中 GROUP_CONCAT函数用法
- 超新星燃烧题解
- HttpContext在一般程序中无法快速导入命名空间,报错,无法使用
- Spring AOP(面向切面)实例及步骤
- Eclipse常用快捷键
- java线程池
- 装箱与拆箱以及性能损失
- hdu 1166 敌兵布阵
- 主成分分析 (Principal Components Analysis, PCA)