select a.`name`,group_concat(b.name SEPARATOR'.') as persons from `group` as a,`person` as b,`persongroup` as c where a.id = c.groupid and b.id = c.personid group by a.`name` 使用group_concat最终得到的数据效果:重复的name 通过group_by已经过滤掉了,同时被过滤数据的persons字段内容进行了追加.
// 统计一个数二进制中的1的个数 #include <stdio.h> int count(int a) { int count = 0; while (a) { count++; a = a & (a - 1); } return count; } int main() { printf("%d\n", count(10)); printf("%d\n", count(0)); printf("%d\n", count(-
1.oracle函数 WMSYS.WM_CONCAT的使用 如图,将图1的结果变成图2的结果,使用函数 WMSYS.WM_CONCAT 即可. 查询语句需要配合使用group by select aa,wmsys.wm_concat(t1.name) from ( select t.name,to_char(t.createdate,'yyyy-mm-dd') aa from td_user t where t.td_conference_id = 3218 and t.status = 1 a