2017-07-14 45 views

回答

0

的應用情況,並與運營商

select Person 
    , case when day_phone is null then alt_phone 
     when day_phone is null and lt_phone is null then Home_phone 
    end 
    from my_table 
0

你可以使用COALESCE函數將返回第一個非空值:

select coalesce(day_phone, alt_phone, Home_phone) 
from person