select deptno,ename,'' comm from (select * from tab1 where comm is not null and deptno=30)
union all
select deptno,'' ename,comm from ( select * from emp where comm is not null and deptno=30)求解 为什么报错

解决方案 »

  1.   


    看看报的是什么错?是不是你comm的字段类型不一致导致的
      

  2.   


    看看报的是什么错?是不是你comm的字段类型不一致导致的报这个错,tab1 我是复制的emp表 不存在字段类型不一致
      

  3.   

    comm是number 类型 好像是这错了
    有什办法可以把这两个查询的值并一块呢?
      

  4.   

    to_char(comm,'FM99999999.99')这样就可以了
      

  5.   

    select deptno,ename, null comm from (select * from tab1 where comm is not null and deptno=30)
    union all
    select deptno,'' ename,comm from ( select * from emp where comm is not null and deptno=30)number 类型用 NULL 用''好像不行  怎么给你分?
      

  6.   

    select deptno,ename, 0 comm from (select * from tab1 where comm is not null and deptno=30)
    union all
    select deptno,'' ename,comm from ( select * from emp where comm is not null and deptno=30)