SQl to list rows if not in another table
- by SmartestVEGA
I have the following query which have 1000 rows
select
staffdiscountstartdate,datediff(day,groupstartdate,staffdiscountstartdate),
EmployeeID
from tblEmployees
where GroupStartDate < '20100301' and StaffDiscountStartDate > '20100301'
and datediff(day,groupstartdate,staffdiscountstartdate)>1
order by staffdiscountstartdate desc
i have the following query which have 400 rows: ie the employees in tblemployees and in tblcards
select a.employeeid,b.employeeid
from tblEmployees a,tblCards b
where GroupStartDate < '20100301'
and StaffDiscountStartDate > '20100301'
and datediff(day,groupstartdate,staffdiscountstartdate)>1
and a.employeeid=b.employeeid
How to list the employees which is there in tblemployees and not in tblcards?
ie is 1000-400 = 600 rows ???