select *, case when resultrate > 0 then case -- <<case嵌套 when Odds > 0 then Odds *ResultRate -- 如果resultrate大于零,且odds大于零,返回结果 when Odds < 0 then ResultRate -- 如果resultrate大于零,且odds小于零,返回结果 end -- >>case嵌套 when resultrate < 0 then case -- <<case嵌套 when Odds > 0 then ResultRate -- 如果resultrate小于零,且odds大于零,返回ResultRate when Odds < 0 then -Odds *ResultRate -- 如果resultrate小于零,且odds小于零,返回-Odds*ResultRate end -- >>case嵌套 end r from soxe_OrderResult --