1

我有表格“排名”和“排名前”,我想在同一个网页上显示它们。(a) 没有占位符工作的代码

  pool.query("select ROW_NUMBER() OVER (order by MName) as Rownum, MName, Tbp,Tgp,Tpp from members inner join ranking on members.id=Member_id and Rank='NM'")

(b) 使用占位符的代码给出 sql 语法错误(错误 1064)

  pool.query("select ROW_NUMBER() OVER (order by MName) as Rownum, MName, Tbp,Tgp,Tpp from members inner join ? on members.id=Member_id and Rank='NM'", 'ranking')

在 where 子句中使用占位符没有任何问题

  pool.query("select ROW_NUMBER() OVER (order by MName) as Rownum, MName, Tbp,Tgp,Tpp from members inner join ranking on members.id=Member_id and Rank=?", 'NM')

看过https://mariadb.com/kb/en/connector-nodejs-promise-api/#placeholder并用谷歌搜索但无法解决。我可以做(b)吗?出了什么问题?谢谢你。

4

0 回答 0