SELECT hosts.host HOST_NAME,group_concat(hstgrp.name) HOST_GROUP FROM hosts JOIN hosts_groups JOIN hstgrp ON hosts.hostid = hosts_groups.hostid AND hosts_groups.groupid = hstgrp.groupid AND hstgrp.name not like 'Templates%' AND hstgrp.name not like 'Database%' AND hstgrp.name like '%云网关(EGW)和云平台(POP)%' AND hosts.status=0 group by HOST_NAME order by HOST_GROUP,HOST_NAME;
SELECT count(0) FROM hosts JOIN hosts_groups JOIN hstgrp ON hosts.hostid = hosts_groups.hostid AND hosts_groups.groupid = hstgrp.groupid AND hstgrp.name not like 'Templates%' AND hstgrp.name not like 'Database%' AND hstgrp.name like '%云网关(EGW)和云平台(POP)%' AND hosts.status=0;