日期:2014-05-16 浏览次数:20919 次
select a.id,
a.claimno ,
a.username ,
a.appealreason ,
a.appealstatus,
a.appealResult,
b.tasksuggestion ,
b.updater ,
(select tasksuggestion from claimTasks where tasktype='ZJPD' and taskid=a.claimno) ptasksuggestion
from
appealInfo a ,
claimTasks b
where
b.tasktype='SSPD' and a.claimno=b.taskid and
appealFlag='1' and 1=1
order by id desc
SELECT A.ID,
A.CLAIMNO,
A.USERNAME,
A.APPEALREASON,
A.APPEALSTATUS,
A.APPEALRESULT,
B.TASKSUGGESTION,
B.UPDATER,
-- (select tasksuggestion from claimTasks where tasktype='ZJPD' and taskid=a.claimno) ptasksuggestion
--以上相对占用资源,可改成decode的写法
DECODE(B.TASKTYPE, 'ZJPD', B.TASKSUGGESTION)
FROM APPEALINFO A, CLAIMTASKS B
WHERE B.TASKTYPE = 'SSPD'
AND A.CLAIMNO = B.TASKID
AND APPEALFLAG = '1'
AND 1 = 1
ORDER BY ID DESC