SQL query problem
- by Pankaj
Hello All
I have 2 tables Project and ProjectList like this
Project
ProjectID
Name
ProjectListID - allow null
In ProjectList
ProjectListID
ProjName
Now what i need here, i want only those recoed from ProjectList table which ProjectListID not in Project table.
I made a query but it is taking lot of time to execute.
select * FROM projectslist pl where pl.ProjectsListID not in (SELECT p.ProjectsListID FROM project p where (p.ProjectsListID is not null and p.ProjectsListID <>0))
Please help me to create optimize query. I am using My SQL.