MySQL错误“正确的语法在'/ * 100,3附近使用','%')AS`百分比`FROM INFORMATION_SCHEMA.PROFILING”

[英]MySQL Error “right syntax to use near '/*100,3), '%') AS `Percentage` FROM INFORMATION_SCHEMA.PROFILING”


I got this weird error after trying to execute a query on a large table:

尝试在大型表上执行查询后,我遇到了这个奇怪的错误:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '/*100,3), '%') AS Percentage FROM INFORMATION_SCHEMA.PROFILING WHERE QUERY_ID=' at line 1

您的SQL语法有错误;查看与您的MySQL服务器版本对应的手册,以便在'/ * 100,3)附近使用正确的语法,'%')AS FROM FROM INFORMATION_SCHEMA.PROFILING的百分比WHERY QUERY_ID ='在第1行

What does it mean?

这是什么意思?

EDIT == this is the query

编辑==这是查询

update cities w, states s set w.region_id = s.id 
where s.code = w.region and w.country_id = s.country_id 

The cities table has around 3 million entries and the states table around 6000

城市表有大约300万个条目,州表大约6000个

Just for the record I executed this query using a mysql client Navicat.

只是为了记录我使用mysql客户端Navicat执行了这个查询。

1 个解决方案

#1


2  

SQL supports C-style comments:

SQL支持C风格的注释:

/* ... */

so it looks like /*100,3 is being interpreted as the beginning of a comment and that comment is wrecking the syntax of the rest of the SQL.

因此看起来/ * 100,3被解释为注释的开头,而该注释正在破坏SQL其余部分的语法。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2011/05/23/2f51b65f5e738586c1a7be3d22ff9cbd.html



 
  © 2014-2022 ITdaan.com 联系我们: