hi all,
i want to get the records from the table which are not available in actual result of a table. the scenario is as follows.
My Actual Result
query which i have written:-
select (cont.FirstName+' '+ISNULL(cont.LastName,'')) as withoutduplicationName
from Contacts cont left join Cities ct on cont.Location=ct.CityId join States st
on cont.WorkState=st.StateId join Recruiters rec on cont.Recruiter=rec.RecruiterId join Team t on
rec.Team=t.TeamId where cont.IsDeleted='false' and rec.IsDeleted='false'
o/p:- it is displaying 534 (count) records.
Eliminating duplicates.
query is as follows
select distinct (cont.FirstName+' '+ISNULL(cont.LastName,'')) as withoutduplicationName
from Contacts cont left join Cities ct on cont.Location=ct.CityId join States st
on cont.WorkState=st.StateId join Recruiters rec on cont.Recruiter=rec.RecruiterId join Team t on
rec.Team=t.TeamId where cont.IsDeleted='false' and rec.IsDeleted='false'
o/P:- it is displaying 495 records.
Now i want to get the records which are not available in my actual result.
i.e 534-495=39 records?
so how to get thest 39 records as an o/p?
please help me to solve this, i have used
except condition in sql but it is not giving proper o/p.