The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > UNIX and Linux Applications
.
google unix.com



UNIX and Linux Applications Discuss UNIX and Linux software applications. This includes SQL, Databases, Middleware, MOM, SOA, EDA, CEP, BI, BPM and similar topics.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
New MySQL Enterprise with Query Analyzer Boosts Database Application Performance iBot MySQL DevZone RSS 0 11-19-2008 04:10 AM
MySQL Query Analyzer: Interview with Mark Matthews iBot MySQL DevZone RSS 0 11-10-2008 10:50 PM
How to query one to many mysql pinkgladiator High Level Programming 0 10-30-2008 01:45 PM
mysql query browser issue venhart UNIX and Linux Applications 3 09-18-2008 07:05 AM
sed command to match log entries jambesh Shell Programming and Scripting 4 07-23-2008 03:08 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-06-2009
hazno hazno is offline
Registered User
  
 

Join Date: Mar 2009
Location: Tokyo
Posts: 21
mysql query all entries which 'dont' match

I am trying to query a list of hosts and extract all entries which 'dont' match.

Code:
SELECT LOGS.host, GOODLIST.host FROM LOGS,db.GOODLIST WHERE (LOGS.host <> GOODLIST.host)
When I use this query, it is very very slow. Matching the host with the GOODLIST.host works great and fast but when I use <> to get the hosts which DONT match, it doesnt work as expected. Am I using the wrong approach?

thanks & regards
  #2 (permalink)  
Old 04-07-2009
vidyadhar85's Avatar
vidyadhar85 vidyadhar85 is offline Forum Staff  
Moderator(The Tutor)
  
 

Join Date: Jun 2008
Location: INDIA
Posts: 1,390
you can try
Code:
SELECT LOGS.host, GOODLIST.host FROM LOGS,db.GOODLIST WHERE GOODLIST.host NOT IN (SELECT LOGS.host from LOGS);
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 08:41 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0