I want to write a Oracle query which will list down all id,name & file from repo1 which has a matching id in file_repo but no matching id found in repo1_status
repo1
id, name
1, abc
2, def
3, emm
4, xdd
file_repo
id, file
1, a.c
2, d.c
3, e.c
4, x.c
repo1_status
id, status, status_desc
1, good, new generated
3, good, new generated
So far I wrote the below query, which does not work. Any help
SELECT repo1.id, name,file
FROM repo1,file_repo,repo1_status
WHERE (repo1.id=file_repo.id and repo1.id!=repo1_status.id)
You could try this
Here is the link about EXISTS
OR
A
left joinlike this is the same asNOT EXISTSand it might have a better performance