+ -
当前位置:首页 → 问答吧 → 有关sql语句急!!!

有关sql语句急!!!

时间:2011-12-01

来源:互联网

select a.nrfl, letterProcessed, letterProcessing from (select nrfl, count(docid) as letterProcessed from wsxf_document where status != 4and create_Date >='2011-11-11 00:00:00' and create_date <= '2011-12-01 23:59:59'group by nrfl) a full outer join (select nrfl, count(docid) as letterProcessing from wsxf_document where status = 4 and create_Date >='2011-11-11 00:00:00' and create_date <= '2011-12-01 23:59:59' group by nrfl) b on a.nrfl = b.nrfl

请教高手,怎样把属于左右表中nrfl字段的的所有的内容在同一个字段中显示出来

作者: longyuzhiyi   发布时间: 2011-12-01

SQL code
-- 如果nrfl字段是字符类型:
select a.nrfl||' '||b.nrfl as ab_nrf1
       ....
from ...


-- 如果nrfl字段是整数类型:
select to_char(a.nrfl,'999999999999999')||' '||to_char(b.nrfl,'999999999999999') as ab_nrf1
       ....
from ...


-- 如果nrfl字段是浮点数类型:
select to_char(a.nrfl,'9999999999999990D999')||' '||to_char(b.nrfl,'9999999999999990D999') as ab_nrf1
       ....
from ...

作者: luoyoumou   发布时间: 2011-12-01