Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MySQL  - All from one table, not if in other

Posted on 2013-01-09
2
Medium Priority
?
209 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
[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
2 Comments
 
LVL 41

Accepted Solution

by:
ralmada earned 2000 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

636 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