Jump to content


  • 0
rwakefie

Combine Collection Queries

Question

Hello,

 

I have two queries that i need to combine to get all systems that do not have the client installed and are windows 7 systems, I have the two queries but i do not know how to combine them. I have seen people using INTER JOIN but i do not know how to use it.

 

Here are my two queries

 

All systems with out a client

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 SMS_R_System.ResourceId not in (select SMS_R_System.ResourceId from SMS_R_System where SMS_R_System.Client = 1)

 

All Windows 7 Systems

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 OperatingSystemNameandVersion like '%Workstation 6.1.7600'

 

I sure this is not that difficult but any help would be greatly appreciated.

 

Thanks

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

make it simple.not in operation is not required here bcz if system has client,it will have value 1 else 0.

You just need to use and operation to the first query like if client=1 and OS is like '%Workstation 6.1.7600'

 

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 SMS_R_System.Client = 0 
and SMS_R_System.OperatingSystemNameandVersion like "%Workstation 6.1"

 

take a look at this guide explaining the basics in SQL from w3schools http://www.w3schools...sql/default.asp

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.