If in query

if (select count(*) from emp)>0
select * from emp