首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > oracle >

语句异常,

2013-03-04 
语句错误,,insert into BT_ACCT_TYPE_T(bill_cycle,serv_id,acct_id,phone_id,product,fee_type1_id,fee_t

语句错误,,

insert into BT_ACCT_TYPE_T
    (bill_cycle,
     serv_id,
     acct_id,
     phone_id,
     product,
     fee_type1_id,
     fee_type2_id,
     month_total_fee,
     month_primal_fee,
     month_discount_fee,
     month_derated_fee,
     month_adjusted_fee)
    select ' 201301 ',
           a.serv_id,
           '''',
           a.phone_id,
           a.product,
           b.fee_type1_id,
           b.fee_type2_id,
           nvl(SUM(a.charge),''0'') month_total_fee,
           nvl(sum(a.primal_charge),''0'') month_primal_fee,
           nvl(sum(a.discount_charge),''0'') month_discount_fee,
           nvl(sum(a.derated_charge),''0'') month_derated_fee,
           nvl(sum(a.adjusted_charge),''0'') month_adjusted_fee
      from bt_evt_bill_'01
          ' a, BT_FEE_TYPE b
     where a.fee_item_id = b.fee_item_id
      and a.phone_id like ''1%''
     group by a.serv_id,
              a.phone_id,
              a.product,
              b.fee_type1_id,
              b.fee_type2_id ';

语句异常,
[解决办法]
格式错误吧?
insert into BT_ACCT_TYPE_T
    (bill_cycle,
     serv_id,
     acct_id,
     phone_id,
     product,
     fee_type1_id,
     fee_type2_id,
     month_total_fee,
     month_primal_fee,
     month_discount_fee,
     month_derated_fee,
     month_adjusted_fee)
    select '201301',
           a.serv_id,
           ' ',
           a.phone_id,
           a.product,
           b.fee_type1_id,
           b.fee_type2_id,


           nvl(SUM(a.charge),'0') month_total_fee,
           nvl(sum(a.primal_charge),'0') month_primal_fee,
           nvl(sum(a.discount_charge),'0') month_discount_fee,
           nvl(sum(a.derated_charge),'0') month_derated_fee,
           nvl(sum(a.adjusted_charge),'0') month_adjusted_fee
      from bt_evt_bill_01  a, BT_FEE_TYPE b
     where a.fee_item_id = b.fee_item_id
      and a.phone_id like '1%'
     group by a.serv_id,
              a.phone_id,
              a.product,
              b.fee_type1_id,
              b.fee_type2_id ;
[解决办法]
语句异常,
好多双引号.
[解决办法]
from bt_evt_bill_'01
          ' a, BT_FEE_TYPE b
     where a.fee_item_id = b.fee_item_id
      and a.phone_id like ''1%''
     group by a.serv_id,
              a.phone_id,
              a.product,
              b.fee_type1_id,
              b.fee_type2_id ';

怎么表名中都出现引号了,你的SQL引号太乱了吧

热点排行