SQL> connect scott/tiger
Connected.
SQL> select * from tab;TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
DEPT                           TABLE
EMP                            TABLE
BONUS                          TABLE
SALGRADE                       TABLESQL> desc dept
 Name                                      Null?    Type
 ----------------------------------------- -------- ---------------
 DEPTNO                                    NOT NULL NUMBER(2)
 DNAME                                              VARCHAR2(14)
 LOC                                                VARCHAR2(13)SQL> create view v_dept as select deptno,dname from dept;View created.SQL> select * from v_dept;    DEPTNO DNAME
---------- --------------
        10 ACCOUNTING
        20 RESEARCH
        30 SALES
        40 OPERATIONSSQL>

解决方案 »

  1.   

    create view v_apptb as
    select tabletype,id,name,nemo from sys_dic 
    union all
    select 'op_op',opid,opname,null from op_op   
    union all 
    select 'base_quest', questid,questname,null from base_quest; 
    不知道楼主是不是要这样的,不过这样的话,就要求这几个表的字段类型必须一致
      

  2.   

    对 就是 bisliu的意思,不过有没有类型转换的方法,因为opid和questid是int型,id是varchar型。
    有没在建视图的时候有转换方法的?
      

  3.   

    更改一下上面 bisliu(努力学习oracle!) 的代码:
    create view v_apptb as
    select tabletype,id,name,nemo from sys_dic 
    union all
    select 'op_op',to_char(opid),opname,null from op_op   
    union all 
    select 'base_quest', to_char(questid),questname,null from base_quest; 用上类型转换就ok  了.