case (select count(*) from dat2 where fx=f2)
when 0 then 'AV'
else 'LA'
end as status