1
select sql_no_cache `labtech`.`computers`.`ComputerID` AS `ComputerId`,0 AS `DeviceId`,`labtech`.`computers`.`LocationID` AS `LocationId`,`labtech`.`computers`.`Name` AS `Name`,`labtech`.`computers`.`Domain` AS `Domain`,`labtech`.`computers`.`LocalAddress` AS `IpAddress`,`labtech`.`computers`.`MAC` AS `Mac`,3 AS `DeviceType`,(select `labtech`.`lookupdevicecode`.`DeviceType` from `labtech`.`lookupdevicecode` where (`labtech`.`lookupdevicecode`.`DeviceCode` = 3)) AS `DeviceName` from `labtech`.`computers` union select 0 AS `ComputerId`,`labtech`.`networkdevices`.`DeviceID` AS `DeviceId`,`labtech`.`networkdevices`.`LocationID` AS `LocationId`,`labtech`.`networkdevices`.`Name` AS `Name`,'' AS `Domain`,`labtech`.`networkdevices`.`IPAddress` AS `IpAddress`,`labtech`.`networkdevices`.`MAC` AS `Mac`,`labtech`.`networkdevices`.`DeviceType` AS `DeviceType`,`labtech`.`lookupdevicecode`.`DeviceType` AS `DeviceName` from (`labtech`.`networkdevices` left join `labtech`.`lookupdevicecode` on((`labtech`.`networkdevices`.`DeviceType` = `labtech`.`lookupdevicecode`.`DeviceCode`))) union select 0 AS `ComputerId`,0 AS `DeviceId`,`labtech`.`founddevice`.`LocationId` AS `LocationId`,'Unknown Device' AS `Name`,'' AS `Domain`,`labtech`.`founddevice`.`IpAddress` AS `IpAddress`,'' AS `Mac`,0 AS `DeviceType`,(select `labtech`.`lookupdevicecode`.`DeviceType` from `labtech`.`lookupdevicecode` where (`labtech`.`lookupdevicecode`.`DeviceCode` = 0)) AS `DeviceName` from `labtech`.`founddevice`