所以在这个例子中,我试图为element2和element3返回一个NULL而不是一个空的nvarchar.我似乎无法在任何地方找到答案,或者甚至可能.我知道我可以使用Case / When的nullif检查.exists(),但我不想为了性能而进行检查.
WqlEventQuery query = new WqlEventQuery(); query.EventClassName = "__InstanceCreationEvent"; query.Condition = "TargetInstance ISA 'Win32_NTLogEvent'"; query.GroupWithinInterval = new TimeSpan(0,10); System.Collections.Specialized.StringCollection collection = new System.Collections.Specialized.StringCollection(); collection.Add("TargetInstance.SourceName"); query.GroupByPropertyList = collection; query.HavingCondition = "NumberOfEvents > 25";