没有成功建立表,建立时,一直显示为正在执行。吃个饭回来都还是正在执行。强制结束。
执行查询语句,select *from w_tp2;也是一直显示为正在执行,但不返回任何结果。
请问,是什么问题,如何成功建立表,彻底清除建立失败的表?语句如下:
create table w_tp2 tablespace ACCOUNT01 as
(
  select to_number(01) * 1E10 + substr(acctid, 2, 9) o_cno,
       (select sum(chrgamount + adjamount - disctamount - wrtoffamount) / 100
          from CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3 b
         where billcycl = '200902'
           and b.acctid = a.acctid) o_yishou
  from CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3 a
 where a.billcycl = '200902'
);

create table w_tp2 tablespace ACCOUNT01 as select * from 
(
  select to_number(01) * 1E10 + substr(acctid, 2, 9) o_cno,
       (select sum(chrgamount + adjamount - disctamount - wrtoffamount) / 100
          from CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3 b
         where billcycl = '200902'
           and b.acctid = a.acctid) o_yishou
  from CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3 a
 where a.billcycl = '200902'
);也是相同的情况。

解决方案 »

  1.   

    这个链接CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3能不能查询出数据啊?
    测试一下
    select rownum
    from CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3
    where rownum=1
      

  2.   

    create内的语句能查询出结果,即,红色标注的语句是正确的。还有,创建失败是产生的空间该如何处理?
    create table w_tp2 tablespace ACCOUNT01 as 

      select to_number(01) * 1E10 + substr(acctid, 2, 9) o_cno, 
          (select sum(chrgamount + adjamount - disctamount - wrtoffamount) / 100 
              from CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3 b 
            where billcycl = '200902' 
              and b.acctid = a.acctid) o_yishou 
      from CHRISCHEUNG.t_Nm_Acct_Debt_Item_200902@hk3 a 
    where a.billcycl = '200902' 

    );