Query working but not as subquery?

Dominique DUCHEMIN 831 Reputation points
2020-12-21T23:48:48.377+00:00

Hello,

I am trying to use the blogs from Kent: https://blog.ctglobalservices.com/configuration-manager-sccm/kea/query-to-find-computers-without-net-framework-35-sp1-installed/

with a query:

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_ADD_REMOVE_PROGRAMS_64 on SMS_G_System_ADD_REMOVE_PROGRAMS_64.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_ADD_REMOVE_PROGRAMS on SMS_G_System_ADD_REMOVE_PROGRAMS.ResourceID = SMS_R_System.ResourceId where SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like "%System Center Endpoint Protection%" or SMS_G_System_ADD_REMOVE_PROGRAMS_64.DisplayName like "%Sophos Endpoint Defense%" or SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%System Center Endpoint Protection%" or SMS_G_System_ADD_REMOVE_PROGRAMS.DisplayName like "%Sophos Endpoint Defense%"
Blockquote

But I am getting an error:
50191-2020-12-21-15-18-31-sccm-query-a1.png

Any idea?
Thanks,
Dom

Microsoft Configuration Manager Application
Microsoft Configuration Manager Application
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Application: A computer program designed to carry out a specific task other than one relating to the operation of the computer itself, typically to be used by end users.
492 questions
Microsoft Configuration Manager
0 comments No comments
{count} votes

Accepted answer
  1. Garth Jones 2,076 Reputation points
    2020-12-22T02:19:26.12+00:00

    A subquery can only have one column.
    But you query has flaw... You can't have a inner join on arp64. Take a look at https://www.enhansoft.com/subselect-wql-query-to-find-pcs-that-do-not-have-either-x86-or-x64-versions-of-software-installed/

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.