Since I still haven't heard from you, I can't directly help you change the code. If you want me to help you change the code, you need to separate the columns in the example and tell you which ones are "duplicates" in your example.
You use group by in your code, according to Prod.ProductName0,sys. Name0,sys. Operating_System_Name_and0, prod. ProductVersion0 is grouped in four columns, which makes only four columns with exactly the same content grouped, which is not what you want.
For example: There are differences in the Version column.
You can adjust your code like this.
select prod.ProductName0 as 'Software Name',max(prod.ProductVersion0) as 'Version',
sys.Name0 as 'Server Name',sys.Operating_System_Name_and0 as 'Operating system'
from ...
Group by Prod.ProductName0,sys.Name0,sys.Operating_System_Name_and0
...
You can use max or min according to your needs. After the group by, delete the column where you use max or min.
Best regards, Percy Tang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 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.