@matteu31
Thank you for posting in Microsoft Q&A forum.
We can get the results without the class SMS_G_System_SYSTEM, like below:
For windows 10 2004:
select *
from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "19041" and SMS_G_System_OPERATING_SYSTEM.Caption like "%windows 10%"
For server 2019:
select *
from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "17763" and SMS_G_System_OPERATING_SYSTEM.Caption like "%Windows Server%"
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.