oracle
select t.hassubreport,WMSYS.WM_CONCAT(t.templeteName) from t_report_reporttemplete t group by t.hassubreport
mysql
select t.hasSubReport,group_concat(t.templeteName) from t_report_reporttemplete t GROUP BY t.hasSubReport
sqlserver
select t.hasSubReport,b=stuff((select ','+f.templeteName from t_report_reporttemplete f where t.hasSubReport=f.hasSubReport for xml path('')),1,1,'')
from t_report_reporttemplete t
group by t.hasSubReport