select a.StudentId,COALESCE( sum(CAST(c.payprice AS decimal(18,3))),0) as sumcopprice from np_Student a, np_InMoney b, np_InMoneylist c where a.StudentId=b.StudentId and b.InMoneyID=c.InMoneyID and a.StudentId=1 group by a.StudentId
select a.StudentId,COALESCE( sum(CAST(c.payprice AS decimal(18,3))),0) as sumcopprice from np_Student a, np_InMoney b, np_InMoneylist c where a.StudentId=b.StudentId and b.InMoneyID=c.InMoneyID group by a.StudentId