1
select sql_no_cache `labtech`.`scheduledscripts`.`scheduledID` AS `scheduledID`,`labtech`.`computers`.`ClientID` AS `ClientID`,`labtech`.`computers`.`LocationID` AS `LocationID`,`labtech`.`scheduledscripts`.`ComputerID` AS `ComputerID`,`labtech`.`scheduledscripts`.`ScriptID` AS `ScriptID`,`labtech`.`scheduledscripts`.`Parameters` AS `Parameters`,`labtech`.`scheduledscripts`.`NextRun` AS `NextRun`,`labtech`.`scheduledscripts`.`Interval` AS `Interval`,`labtech`.`scheduledscripts`.`Repeat` AS `Repeat` from (`labtech`.`scheduledscripts` left join `labtech`.`computers` on((`labtech`.`scheduledscripts`.`ComputerID` = `labtech`.`computers`.`ComputerID`))) where (`labtech`.`scheduledscripts`.`ComputerID` <> 0) union select `labtech`.`scheduledscripts`.`scheduledID` AS `scheduledID`,`labtech`.`computers`.`ClientID` AS `ClientID`,`labtech`.`computers`.`LocationID` AS `LocationID`,`labtech`.`computers`.`ComputerID` AS `ComputerID`,`labtech`.`scheduledscripts`.`ScriptID` AS `ScriptID`,`labtech`.`scheduledscripts`.`Parameters` AS `Parameters`,`labtech`.`scheduledscripts`.`NextRun` AS `NextRun`,`labtech`.`scheduledscripts`.`Interval` AS `Interval`,`labtech`.`scheduledscripts`.`Repeat` AS `Repeat` from (`labtech`.`scheduledscripts` join `labtech`.`computers`) where ((`labtech`.`scheduledscripts`.`ComputerID` = 0) and (`labtech`.`scheduledscripts`.`LocationID` <> 0) and (`labtech`.`computers`.`LocationID` = `labtech`.`scheduledscripts`.`LocationID`)) union select `labtech`.`scheduledscripts`.`scheduledID` AS `scheduledID`,`labtech`.`computers`.`ClientID` AS `ClientID`,`labtech`.`computers`.`LocationID` AS `LocationID`,`labtech`.`computers`.`ComputerID` AS `ComputerID`,`labtech`.`scheduledscripts`.`ScriptID` AS `ScriptID`,`labtech`.`scheduledscripts`.`Parameters` AS `Parameters`,`labtech`.`scheduledscripts`.`NextRun` AS `NextRun`,`labtech`.`scheduledscripts`.`Interval` AS `Interval`,`labtech`.`scheduledscripts`.`Repeat` AS `Repeat` from (`labtech`.`scheduledscripts` join `labtech`.`computers`) where ((`labtech`.`scheduledscripts`.`ComputerID` = 0) and (`labtech`.`scheduledscripts`.`LocationID` = 0) and (`labtech`.`scheduledscripts`.`ClientID` <> 0) and (`labtech`.`computers`.`ClientID` = `labtech`.`scheduledscripts`.`ClientID`)) union select `labtech`.`scheduledscripts`.`scheduledID` AS `scheduledID`,`labtech`.`computers`.`ClientID` AS `ClientID`,`labtech`.`computers`.`LocationID` AS `LocationID`,`labtech`.`computers`.`ComputerID` AS `ComputerID`,`labtech`.`scheduledscripts`.`ScriptID` AS `ScriptID`,`labtech`.`scheduledscripts`.`Parameters` AS `Parameters`,`labtech`.`scheduledscripts`.`NextRun` AS `NextRun`,`labtech`.`scheduledscripts`.`Interval` AS `Interval`,`labtech`.`scheduledscripts`.`Repeat` AS `Repeat` from (`labtech`.`scheduledscripts` join `labtech`.`computers`) where ((`labtech`.`scheduledscripts`.`ComputerID` = 0) and (`labtech`.`scheduledscripts`.`LocationID` = 0) and (`labtech`.`scheduledscripts`.`ClientID` = 0))