select * from where id='224 and select count(*) from tmp'
select * from where id = 224 and (select count(*) from tmp)>0