一月
select * from billing.t_rytcdr01_sz0
2月
select * from billing.t_rytcdr02_sz0我想在就是想查询当前月份表的数据,怎么处理啊!

解决方案 »

  1.   

    Try it ..
    SQL> select 'billing.t_rytcdr'||to_char(sysdate,'mm')||'_sz0'
      2    from dual;'BILLING.T_RYTCDR'||TO_CHAR(SY
    ------------------------------
    billing.t_rytcdr07_sz0
      

  2.   

    我可能没有说明白把
    我要检索billing.t_rytcdr07_sz0里的数据
      

  3.   

    用存储过程动态SQL返回游标:
    create or replace procedure getData(tabelName in varchar2,myCursor out sys_refcursor) 
    as 
    str   varchar2(200); 
    begin
      str:='select * from billing.t_rytcdr'||to_char(sysdate,'mm')||'_sz0';
      open myCursor for str; 
    exception 
      when others then 
        dbms_output.PUT_LINE(sqlcode | |',' | |sqlerrm); 
    end getData;