Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL Query Problems! Wrong results being displayed!

$
0
0

Hi,

I am trying to create a report which displays all of the terminals that are either Desktops or Laptops within the network that do not have Symantec AV installed on them.

This is the query I have written. The software id's 25, 238 and 888 are the different types of Symantec that could be installed on each terminal.


SELECT DISTINCT devices.ip_address, devices.current_user, devices.device_type, devices.manufacturer, devices.operating_system, devices.serial_number
FROM devices, software_installations, software
WHERE devices.id = software_installations.computer_id
AND software.id = software_installations.software_id
AND (software_installations.software_id <>'25' OR software_installations.software_id <>'238'
  OR software_installations.software_id <>'888')
AND (devices.device_type = 'Desktop' OR devices.device_type = 'Laptop');


Instead of giving the correct results it displays terminals which have it installed! It might be my coding but it could be the fact the database is out of date, I have tried to update it but the same problems keep reoccurring.

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>