方法1: ISNULL PS: ISNULL函数是判断字段时候为null,如果为null返回0. SELECT ISNULL(A字段,0)-ISNULL(B字段,0) FROM 表 方法2: case when PS:如果a-b is null 就是0,否则a-b。 select case when x.……