Skip to content

Combine Collection Queries

Featured Replies

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

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

Join the conversation

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

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.