Using Case with no column result I made this solution but it continues not returning any value If the user not exists.

select
    case when TypeId = 1 then 1 
         when TypeId = 0 then 2
         when count(1) &lt; 1 then 3
         end 
    from Type 
    where mail = 'name@test.com'
    group by Type
Application would be much better place to deal with such cases as Aaron Bertrand said but you can do it with SQL as well .

select
    case when TypeId = 1 then 1 
         when TypeId = 0 then 2
         end 
    from Type 
    where mail = 'name@test.com'
UNION ALL 
SELECT 3 
FROM DUAL 
 WHERE NOT EXISTS (SELECT NULL FROM Type WHERE mail = 'name@test.com')


**Depends on RDMS you're using you may or may not need specify "FROM DUAL".