Zend_Db_Select 加入帮助
我正在使用以下代码并收到以下错误
$select = $model->select();
$select->from(array('stocktakejob'),
array("ProductID" => "stocktakejob.ProductID",
"TotalCount" => "SUM(stocktakejob.NewCount)"
)
)->join(array('products'),
'products.ProductID = stocktakejob.ProductID',
array("ProductCode" => "products.ProductCode")
)->where("stocktakejob.StockTakeID = ".$stocktake->getStockTakeID())
->group('stocktakejob.ProductID');
错误:异常
Select query cannot join with another table
我缺少什么吗?任何帮助将不胜感激。
i'm using the following code and get the following error
$select = $model->select();
$select->from(array('stocktakejob'),
array("ProductID" => "stocktakejob.ProductID",
"TotalCount" => "SUM(stocktakejob.NewCount)"
)
)->join(array('products'),
'products.ProductID = stocktakejob.ProductID',
array("ProductCode" => "products.ProductCode")
)->where("stocktakejob.StockTakeID = ".$stocktake->getStockTakeID())
->group('stocktakejob.ProductID');
error: Exception
Select query cannot join with another table
Is there something i'm missing ? anyhelp would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为在创建 join 语句时应该将完整性检查设置为 false:
I think that you should set integrity check to false when making join statements: