select machine_name, count(machine_name) from t_agents where t_agents.dmaccount is not null and t_agents.dmaccount != ""
and t_agents.dmaccount not like "test_%"
and t_agents.dmaccount in
(
select dmname from t_dmlogin_log where DATEDIFF(t_dmlogin_log.createtime, '2016-6-3') = 0
group by dmname having dmname in
(
select dmacct from t_vm_infos where dmacct is not null and dmacct != "" and status = 3
)
)
group by machine_name數據庫
select * from t_agents where t_agents.dmaccount is not null and t_agents.dmaccount != ""
and t_agents.dmaccount not like "test_%"
and t_agents.dmaccount in
(
select dmname from t_dmlogin_log where DATEDIFF(t_dmlogin_log.createtime, '2016-5-30') = 0
group by dmname having dmname in
(
select dmacct from t_vm_infos where dmacct is not null and dmacct != "" and status = 3
)
)spa