sql中分母为零处理

    技术2022-05-11  110

    select a, b, a/b from tabName 当b=0时出错,解决方法: select a, b, (case when b=0 then 0 else a/b end) from tabName 

    最新回复(0)