Sybase SQL:在 IF 和 CASE 语句中使用条件运算符

Sybase SQL : Use of Condition operator in IF and CASE statement

我想在 IF 和 CASE 语句中使用大于和小于运算符,但它不起作用。我无法找到任何解决方案。 我想要做的是,如果 TotalPurchases 大于 10,则用 0 替换所有值,否则用 q

替换所有值
Select  pur_mst.n_srno, act_mst.c_code, act_mst.c_name , 
sum (pur_mst.n_subtotal)TotalPurchases,
            ( CASE TotalPurchases 
            WHEN TotalPurchases > 10
            THEN TotalPurchases = 0
            ELSE TotalPurchases  = 20 ) as type
            from act_mst join pur_mst ON
            act_mst.c_code = pur_mst.c_supp_code  
            Group by pur_mst.n_srno,
            act_mst.c_code, act_mst.c_name

更正

时的 Case 语法
 Select  pur_mst.n_srno, act_mst.c_code, act_mst.c_name , 
        CASE 
        WHEN sum (pur_mst.n_subtotal) > 10 THEN  0
        ELSE  20 End as TotalPurchases
        from act_mst join pur_mst ON
        act_mst.c_code = pur_mst.c_supp_code  
        Group by pur_mst.n_srno,
        act_mst.c_code, act_mst.c_name