?
Solved

An SQL Query for a specific executable that is NOT on a machine

Posted on 2011-09-09
3
Medium Priority
?
290 Views
Last Modified: 2012-05-12
I am new to sql queries - I have no problem finding something that IS on a machine, but today I was asked to find machines that do NOT have a specific executable.

In this case, I am only looking for "someprogram.exe" to not be on a machine, and I don't want to see all the programs that are not like "someprogram.exe" because that will list everything on the machines.

How would I write a query to look for something to not be on the machine.

Just to keep it easy - lets say everything is in one table so we don't need to join anything - I just need to know some basic syntax.

Thanks
0
Comment
Question by:pgroth
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 6

Accepted Solution

by:
mjfagan earned 500 total points
ID: 36512739
Check out the IN and EXISTS functions.  You can do NOT IN and NOT EXISTS.

http://www.techonthenet.com/sql/in.php
      
http://www.techonthenet.com/sql/exists.php
      
0
 
LVL 42

Expert Comment

by:dqmq
ID: 36512758
select MachineID from yourtable  t1
  where not exists
        (select * from yourtable t2
            where  t2.programname name = 'someprogrem.exe'
                and t2.machineID = t1.machineid)
0
 

Author Closing Comment

by:pgroth
ID: 36512781
Thanks - I believe the Exists command should work... not exists specifically.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question