标签:sp 问题 bs as nbsp br ca ip rom
今天遇到一个问题,以下是两种查询方式,但是查询出来的结果不一样,第二种查询出来的结果是正确的,如果将第一种查询的lendrequestId去掉,查询结果就会和第二种一样,这是为什么?
1.SELECT rr.lendRequestId,
(case when rr.repayState = ‘OVER_DUE_REPAID‘ then sum(rr.repayPrincipal) end) as 逾期还款本金
FROM dwloanrepayrecordfact rr
GROUP BY rr.lendRequestId
2.SELECT rr.lendRequestId, sum(rr.repayPrincipal)
FROM dwloanrepayrecordfact rr
WHERE rr.repayState = ‘OVER_DUE_REPAID‘
GROUP BY rr.lendRequestId
标签:sp 问题 bs as nbsp br ca ip rom
原文地址:http://www.cnblogs.com/rufengboyi/p/4147518.html