select (case when 第二字段 is not null then 第二字段 else 第一字段 end) 字段名 from table_name;
使用decode函数,或者case when 或者if then就可以了!