0
Select A.Smscid,
       A.Delivery_Date,
       A.Type,
       A.End_Delivery,
       A.Volume,
       (Case When A.Type='Transactional' And A.End_Delivery=B.Operator 
             Then (A.Volume*B.Onnet_Trans_Cost)) As "COST",
 From Telco_Success a,operators_cost b;

我收到缺少关键字错误:

4

1 回答 1

5

未经测试,但您似乎缺少声明中的End关键字Case。此外,您似乎在“COST”之后有一个逗号,这是不需要的。

Select A.Smscid,
       A.Delivery_Date,
       A.Type,
       A.End_Delivery,
       A.Volume,
       (Case When A.Type='Transactional' And A.End_Delivery=B.Operator 
             Then (A.Volume*B.Onnet_Trans_Cost) End) As "COST"
 From Telco_Success a,operators_cost b;
于 2012-12-13T11:43:07.010 回答