Im trying to create a query that will list all the computers a piece of software is installed on. The systems are in there own table called system and identified by a number called system_id. The software is in the table sys_sw_software and the ID tied to the system_id is called system_id.
I would like to search for the name of a piece of software which is called software_name and then get a list of all the systems that its installed on from system table.
select
system.hostname,
sys_sw_software.software_name,
sys_sw_software.software_publisher,
sys_sw_software.software_version
from system
inner join sys_sw_software on sys_sw_software.system_id = system.system_id
where sys_sw_software.timestamp = system.timestamp
AND sys_sw_software.software_name = 'Software Name'
dsacker
What does requiring the two timestamps equal accomplish. Just curious, as logically, I saw a simple join by system_id?
maximus81
ASKER
If you don't add the timestamps you get all the old data also. This ensures that you get the newest information from the database. Let say I deleted a piece of software off a machine and then I ran the audit script, without the timsetamps it would add that to the query.
select
system.hostname,
sys_sw_software.software_n
sys_sw_software.software_p
sys_sw_software.software_v
from system
inner join sys_sw_software on sys_sw_software.system_id = system.system_id
where sys_sw_software.timestamp = system.timestamp
AND sys_sw_software.software_n