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

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_39704078/article/details/82529882

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

猜你喜欢

转载自blog.csdn.net/weixin_39704078/article/details/82529882
今日推荐