日期:2014-05-18 浏览次数:20679 次
select cellphone,count(1) from mdao_member where accountid = ? group by cellphone
------解决方案--------------------
分开查询吧。
------解决方案--------------------
order by groupid
------解决方案--------------------
用STUFF函数
------解决方案--------------------
select a.groupid,STUFF((select ';'+cellphone from mdao_member where groupid=a.groupid for xml path('')),1,1,'') as cellphone from mdao_member as a where a.accountid = ? group by a.groupid
------解决方案--------------------
select cellphone,count(*) from mdao_member where accountid = ? group by groupid