日期:2014-05-17 浏览次数:21147 次
-- 用union all加以解决:
-- 例如:
select c1, c2
from (select c1, c2 from tb_name
union all
select 'hello' as c1, 'world' as c2 from dual) t
where rownum=1;
select c1, c2
from (select ename as c1, job as c2 from emp where empno=7900
union all
select 'hello' as c1, 'world' as c2 from dual) t
where rownum=1;
select c1, c2
from (select ename as c1, job as c2 from emp where empno=7901
union all
select 'hello' as c1, 'world' as c2 from dual) t
where rownum=1;
select max(dummy) dmy,'hello world' hi from dual where 1=1;
select max(dummy) dmy,'hello world' hi from dual where 1=2;