Fetch the employee having no address?
I am new to database programming.
I have a database structure here.
I want to Fetch all the employee having no address.
It should fetch employee with id as 3.
How i can do this?
This query should do
select * from emp where id not in(select distinct(id) from address);
select * from emp as e left join address as a on e.id=a.id where a.id is null