1
select `cmp`.`ClientID` AS `ClientID`,`cmp`.`LocationID` AS `LocationID`,`cmp`.`ComputerID` AS `ComputerID`,`hf`.`HotFixID` AS `HotfixID`,`hfd`.`Title` AS `HotfixTitle`,`hfd`.`kbID` AS `HotfixKB`,`hfd`.`Bulletin` AS `HotfixBulletin`,`hfd`.`Description` AS `HotfixDescription`,`hfd`.`Date_Added` AS `HotfixDateAdded`,`hfd`.`CategoryName` AS `HotfixCategory`,if((trim(`hfd`.`Severity`) = ''),'Unspecified',`hfd`.`Severity`) AS `HotfixSeverity`,`hfd`.`PatchType` AS `HotfixPatchType`,`hfd`.`OS` AS `HotfixOS`,`hfd`.`Ignore` AS `HotfixIgnore`,`hf`.`Approved` AS `HotfixApproved`,`hf`.`Pushed` AS `HotfixPushed`,`hf`.`Installed` AS `HotfixInstalled`,`hf`.`Failed` AS `HotfixFailed`,`hf`.`InstallDate` AS `HotfixInstallDate`,`hf`.`FinishedDate` AS `HotfixFinishedDate` from ((`labtech`.`computers` `cmp` join `labtech`.`hotfix` `hf` on((`cmp`.`ComputerID` = `hf`.`ComputerID`))) join `labtech`.`hotfixdata` `hfd` on(((`hf`.`HotFixID` = `hfd`.`HotFixID`) and (`hf`.`OS` = `hfd`.`OS`)))) where (`hf`.`Approved` = if(((select ifnull(`labtech`.`patchmanagersettings`.`Value`,0) from `labtech`.`patchmanagersettings` where (`labtech`.`patchmanagersettings`.`Name` = 'IsUsingNewPatching') limit 1) = 1),2,1))