jnelson993
Posts: 899
Score: 127 Joined: 2/18/2005 From: Minneapolis, MN Status: offline
|
Yeah, Matthew's right on, if you're combining the output of those 2 queries (meaning you want to take all of the computers in the first query AND all of the computers in the second query) then just adding queries is a nice easy way to go. It's the equivalent of one big query that uses OR in the WHERE clause like "WHERE this=blah OR that = blah" However, if you want to only have it return only those machines that are in BOTH queries, then you need to combine the queries into one. Using your 2 queries as an example: Results of first query and second query combined: SELECT sys.ResourceID, sys.ResourceType, sys.Name, sys.SMSUniqueIdentifier, sys.ResourceDomainORWorkgroup, sys.Client FROM SMS_R_System AS sys WHERE sys.ResourceID NOT IN (SELECT ARP.ResourceID FROM SMS_G_System_ADD_REMOVE_PROGRAMS AS ARP WHERE ARP.DisplayName = "SoftwareDisplayName" AND ARP.Version = "1.0.0.0.1") OR sys.SystemGroupName = "MyDomain\\MyDomainGroupName" Machines that exist in first query AND second query: SELECT sys.ResourceID, sys.ResourceType, sys.Name, sys.SMSUniqueIdentifier, sys.ResourceDomainORWorkgroup, sys.Client FROM SMS_R_System AS sys WHERE sys.ResourceID NOT IN (SELECT ARP.ResourceID FROM SMS_G_System_ADD_REMOVE_PROGRAMS AS ARP WHERE ARP.DisplayName = "SoftwareDisplayName" AND ARP.Version = "1.0.0.0.1") AND sys.SystemGroupName = "MyDomain\\MyDomainGroupName"
< Message edited by jnelson993 -- 8/11/2008 11:38:57 AM >
_____________________________
Number2 (John Nelson) MyITForum - Blog MyITForum - Forum Posts
|