Javascript Google BigQuery错误:语法错误:非法输入字符%&引用;
我正在尝试使用Google的BigQueryNodeJS库,但是,我一直遇到这个错误 输入示例:Javascript Google BigQuery错误:语法错误:非法输入字符%&引用;,javascript,node.js,google-cloud-platform,google-bigquery,Javascript,Node.js,Google Cloud Platform,Google Bigquery,我正在尝试使用Google的BigQueryNodeJS库,但是,我一直遇到这个错误 输入示例: {"name": "John Doe", "gameid": "048.611"} 下面是我的一个查询示例 const query = 'select * from gametag_ae.users where GAMEID like %' + gameid + '% where NAME like %' + name
{"name": "John Doe", "gameid": "048.611"}
下面是我的一个查询示例
const query = 'select * from gametag_ae.users where GAMEID like %' + gameid + '% where NAME like %' + name + '% LIMIT 1';
这就是我得到的错误:
(node:6802) UnhandledPromiseRejectionWarning: Error: Syntax error: Illegal input character "%" at [1:64]
在这种情况下,我不能使用运算符%
,但这是此查询所必需的
有什么更好的方法可以让它工作呢?请使用下面的方法
const query = 'select * from gametag_ae.users where GAMEID like "%' + gameid + '%" AND NAME like "%' + name + '%" LIMIT 1';
通配符模式必须在引号中。