logo

Previous Thread:   Register Key

11/16/2005 4:24:59 PM    subselect query in collection
Hi,  
  
I would like to create a collection that exclude's the systems in collection  
  
B from the systems in collection A.  
  
The query for collection A (all systems with setup version 1.0) is:  
  
select SMS_R_System.ResourceId, SMS_R_System.ResourceType,  
  
SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier,  
  
SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client  
  
from  SMS_R_System  
  
inner join SMS_G_System_SETUP on SMS_G_System_SETUP.ResourceID =  
  
SMS_R_System.ResourceId where SMS_G_System_SETUP.Version = "1.0"  
  
The query for collection B (all systems in a specific OU) is:  
  
select SMS_R_System.ResourceID, SMS_R_System.ResourceType,  
  
SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier,  
  
SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client  
  
from SMS_R_System  
  
where SystemOUName = "Domain/ORG/SomeOU"  
  
I try to create a collection of all systems with setup version 1.0 but not  
  
the systems in the specific OU. I create the first query (Collection A) and  
  
then create the second query choosing the criterion type 'Subselected  
  
values'. This results in the following Query statement:  
  
select SMS_R_System.ResourceId, SMS_R_System.ResourceType,  
  
SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier,  
  
SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client  
  
from  SMS_R_System  
  
inner join SMS_G_System_SETUP on SMS_G_System_SETUP.ResourceID =  
  
SMS_R_System.ResourceId where SMS_G_System_SETUP.Version = "1.0"  
  
and SMS_R_System.ResourceId not in  
  
(select SMS_R_System.ResourceID, SMS_R_System.ResourceType,  
  
SMS_R_System.Name, SMS_R_System.SMSUniqueIdentifier,  
  
SMS_R_System.ResourceDomainORWorkgroup, SMS_R_System.Client  
  
from SMS_R_System  
  
where SystemOUName = "Domain/ORG/SomeOU")  
  
The Query Design looks OK but when I try to close the Query Rule Properties  
  
window I get the error: "The query statement that you entered is not valid.  
  
Please enter a valid query statement."  
  
What is the valid query statement????  
  
With kind regards,  
  
Ramon Kroese



11/16/2005 5:39:57 PM    Re: subselect query in collection
Try deleting anything but the ResourceID from the subselection query: ie:  
  
.....and SMS_R_System.ResourceId not in (select SMS_R_System.ResourceID from  
  
SMS_R_System where SystemOUName = "Domain/ORG/SomeOU")  
  
/Rune  
  
(select  
  
"Kroese, Ramon" <Ramon_poeint_Kroese@wur.nl> wrote in message  
  
news:u%2334sHs6FHA.1188@TK2MSFTNGP12.phx.gbl...

11/18/2005 8:54:55 PM    Re: subselect query in collection
Thanks that was the solution.  
  
"Rune Norberg" <runeno@online.no_nospam> wrote in message  
  
news:uJ%23mmxs6FHA.2192@TK2MSFTNGP14.phx.gbl...