Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

MySQL - All from one table, not if in other

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
Rush_2112
Asked:
Rush_2112
1 Solution
 
ralmadaCommented:
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
 
Rush_2112Author Commented:
I found that this works:

AND (Manager_Filter.`Unique` NOT IN (Select `Unique` from tblLock))
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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now