错误:MySQL - 操作数应该包含1列。
P粉529245050
2023-07-24 18:17:13
<p>这个查询在我直接在MySQL中输入时可以工作,但在C#中却不行。</p>
<pre class="brush:php;toolbar:false;">double deltaTime = (DateTime.Now - collectTime).TotalSeconds;
string query = String.Format("UPDATE buildings LEFT JOIN server_buildings ON buildings.global_id = server_buildings.global_id AND buildings.level = server_buildings.level SET buildings.storage = buildings.storage + (server_buildings.speed * {0} * IF(buildings.boost >= NOW(), 2, 1)) WHERE buildings.global_id IN('generator', 'test')", deltaTime / 3600d);</pre>
<p>只是得到了错误MySQL - 操作数应该包含1列。感谢建议! :)</p><p>预计随着时间的推移,它会在"storage"中增加值。</p><p><br /></p>
我对MySQL还比较新。这是带有参数的查询。