我正在尝试使用Visual Studio 2010
(c#
)更新我的mysql
表“upproj”。 我想执行以下查询:Mysql更新查询错误
string Query = " update tlog.upproj set summ=(select sum(grade) from tlog.upproj group by ams having count(*) =2); ";
,但我得到的错误
"You can't specify target table 'upproj' for update in FROM clause".
当我执行上Mysql
查询浏览器之前的查询我没有得到任何错误,但我的项目需要从Visual Studio执行此查询。
有什么办法解决这个问题吗?
感谢您的编辑:) – GreatGatsby
“UPDATE”查询的目的究竟是什么?如果*有效,它将更新表中的每一行,因为没有设置WHERE子句。 – newfurniturey
并在类似的问题上看到[这个答案](http://stackoverflow.com/a/14302701/1385896)。 –