Solved

MySQL  - All from one table, not if in other

Posted on 2013-01-09
2
189 Views
Last Modified: 2013-01-09
I have a table called Master, with a field in it called Unique.

I have a separate table, called tblLock, also with a field called Unique (both varchar)

I want a view of all the records in Master, UNLESS the unique fields match.  So the tblLock table excludes records from Master.

Thanks
0
Comment
Question by:Rush_2112
2 Comments
 
LVL 41

Accepted Solution

by:
ralmada earned 500 total points
ID: 38760247
you can try

select a.id, a.col1, a.col2
from Master a
left join tblLock b on a.id = b.id
where b.id is null
0
 
LVL 1

Author Comment

by:Rush_2112
ID: 38760363
I found that this works:

AND (Manager_Filter.`Unique` NOT IN (Select `Unique` from tblLock))
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Creating and Managing Databases with phpMyAdmin in cPanel.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now