我在执行查询时遇到错误:
' b'
附近的语法不正确
代码:
using(var db = new GnpCoreDatabase())
{
var basket = db.Query<Basket>
("select p.product_tax,c.shipping_cost FROM dbo.Basket b
join dbo.CompanyProducts cp b.CompanyProduct_Id = cp.Product_Id
join dbo.products p on p.Product_Id = cp.Product_Id
join dbo.Company c on c.company_Id = cp.Company_Id
where b.Added_by =@0", 1).Select(x => new Basket() {
Tax = x.Tax,
ShippingCost = x.ShippingCost,
IsSuccessfull = true
}).SingleOrDefault();
basket.Items = GetAllItems();
return basket;
}
我不明白为什么会出现这种错误。我在数据库中运行此查询并生成结果。
答案 0 :(得分:2)
您在第一个InitiatingHeapOccupancyPercent
上错过了ON
关键字:
JOIN