我正在使用oracle数据库开发一个dot net项目,在存储库中我有这个LINQ查询
var results = (from svd in context.SALESINVOICEDETAILs.Where(x=>x.INVOICENO==inv.INVOICECODE)
join pd in context.PRODUCTs on svd.PRODUCTCODE equals pd.PRODUCTCODE
//group pd by pd.BRANDID into grouping
group new { svd, pd } by new { pd.BRANDID } into grouping
select new
{
price = grouping.Sum(x=>x.svd.UNITPRICE*x.svd.QUANTITY) ,
discount = grouping.Sum(x => x.svd.DISCOUNT * x.svd.QUANTITY),
brandId = grouping.Key
}
).ToList();
现在这在我的本地电脑上工作正常。但是当我在服务器中实现它时,它会抛出异常
{"ORA-00904: \"Project2\".\"BRANDID\": invalid identifier"}
如果我评论出价格和折扣,它也可以正常运行。正在运行这两行的例外
price = grouping.Sum(x=>x.svd.UNITPRICE*x.svd.QUANTITY) ,
discount = grouping.Sum(x => x.svd.DISCOUNT * x.svd.QUANTITY)
任何人都可以告诉为什么这在本地电脑上工作正常但在服务器中出错?或解决问题