|
楼主 |
发表于 2006-12-30 20:15:34
|
显示全部楼层
[请求]
SELECT dbo.LEND_CONTRACT.[no] AS contractno,
dbo.LEND_CONTRACT.name AS contractname,
dbo.LEND_CONTRACT.plan_return_date AS returndate, ISNULL (lendfufil.lendmoney,
0.00) AS lend, ISNULL(lendfufil.lendmoney, 0.00) AS planreturnmoney,
ISNULL(returnloan.returnlend, 0.00) AS reversion
FROM dbo.LEND_CONTRACT LEFT OUTER JOIN
(SELECT lend_contract_id, isNull(SUM(fufil_money), 0.00) AS lendmoney
FROM lend_fufil
GROUP BY lend_contract_id) lendfufil ON
dbo.LEND_CONTRACT.id = lendfufil.lend_contract_id LEFT OUTER JOIN
(SELECT contract_id, isNull(SUM(return_sum), 0.00) AS returnlend
FROM return_loan
GROUP BY contract_id) returnloan ON
dbo.LEND_CONTRACT.id = returnloan.contract_id
这个为物理层视图;其他资源见附件 |
|