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)求解 为什么报错
union all
select deptno,'' ename,comm from ( select * from emp where comm is not null and deptno=30)求解 为什么报错
看看报的是什么错?是不是你comm的字段类型不一致导致的
看看报的是什么错?是不是你comm的字段类型不一致导致的报这个错,tab1 我是复制的emp表 不存在字段类型不一致
有什办法可以把这两个查询的值并一块呢?
union all
select deptno,'' ename,comm from ( select * from emp where comm is not null and deptno=30)number 类型用 NULL 用''好像不行 怎么给你分?
union all
select deptno,'' ename,comm from ( select * from emp where comm is not null and deptno=30)