SQL新手问题的一点。
如果我有一个符合以下内容的表格:
host fault fatal groupname Host A Data smells iffy n research Host B flanklecrumpet needs a cuddle y production Host A RAM loves EWE n research Host Z One of the crossbeams gone askew on the treadle y research
..我想获取一些统计信息,..
select count(distinct host) as hosts,count(host) as faults,group from tablename group by groupname
..这使我可以了解每个组名的故障数和受影响的主机。
hosts faults groupname
2 3 research
1 1 production
我可以在同一查询中显示致命条目的数量吗?