使用CASE 语句select Case column1 when a then (select column2 from table2 where table1.id = table2.id) else column1 end from table1
case when~