This blog post goes with the Subset Query post. This is the SQL example with a few tips.


  • Doesn’t this look exactly like WQL Post? Yes it is supposed to look exactly alike, it is intended to show the same query so that it is easy to follow from one example to another.
  • For the positive query don’t return the PC name because of the possibility of duplicate PC Names instead return ResourceID
  • I also like to keep my query clean of the junk. I think that they run faster.


Below is what the positive query would look like.


Now the negative query

Select             v_GS_COMPUTER_SYSTEM.Name0from             v_GS_COMPUTER_SYSTEMWhere             v_GS_COMPUTER_SYSTEM.ResourceID not in ( SELECT                         v_GS_ADD_REMOVE_PROGRAMS.ResourceID            FROM                         v_GS_ADD_REMOVE_PROGRAMS v_GS_ADD_REMOVE_PROGRAMS            WHERE                                   v_GS_ADD_REMOVE_PROGRAMS.DisplayName0=’Visio 12′)

Hopefully this gives you an insight on how to create and use subset queries.