1. 程式人生 > >mysql---case when...then...else...end

mysql---case when...then...else...end

select

(case when price_input is null then price else price_input end)  price

from coin_price

where date = #{date}

當price_input為空的話,將price的值給price_input