1
select distinct `pgp`.`ComputerLevelOverride` AS `ComputerLevelOverride`,`pgp`.`Priority` AS `Priority`,`pgp`.`GroupName` AS `GroupName`,`pgp`.`InstallPolicy` AS `InstallPolicyID`,ifnull((select `isp`.`Name` from `labtech`.`installsoftwarepolicies` `isp` where (`isp`.`ID` = `pgp`.`InstallPolicy`)),'Not Set') AS `InstallPolicy`,`pgp`.`SoftwarePolicy` AS `SoftwarePolicyID`,ifnull((select `isp`.`Name` from `labtech`.`installsoftwarepolicies` `isp` where (`isp`.`ID` = `pgp`.`SoftwarePolicy`)),'Not Set') AS `SoftwarePolicy`,`pgp`.`RebootPolicy` AS `RebootPolicyID`,ifnull((select `rp`.`Name` from `labtech`.`rebootpolicies` `rp` where (`rp`.`ID` = `pgp`.`RebootPolicy`)),'Not Set') AS `RebootPolicy`,(select count(0) from `labtech`.`patchgroupapprovalpolicies` `pgap` where (`pgap`.`ComputerLevelOverride` = `pgp`.`ComputerLevelOverride`)) AS `ApprovalPolicies` from `labtech`.`patchgrouppolicies` `pgp` where (`pgp`.`ComputerLevelOverride` > 0)