SQL语句的问题
select department.cdepname,distinct(fitemss97.citemName),inventory.cInvName,'iPrice'=sum(n.iprice) "+"from RdRecords m "+
"right join rdrecords n "+
"on m.cInvcode=n.cDefine22 "+
"left join fitemss97 "+
"on n.citemcode=fitemss97.citemcode "+
"inner join rdrecord "+
"on m.ID=rdrecord.ID "+
"inner join department "+
"on rdrecord.cDepCode=department.cDepCode "+
"inner join inventory "+
"on m.cInvcode=inventory.cInvcode "+
"where rdrecord.cvouchtype='10' "+
"and datepart(year,rdrecord.ddate)='"+ddlYear.SelectedItem.Value+"'"+
"and datepart(month,rdrecord.ddate)='" +ddlMonth.SelectedItem.Value+"'"+
"group by fitemss97.citemname
主要想把fitemss97.citemname重复的数据去掉sum(n.iprice) 相加