我在 node.js 项目中看到了这一点。
sequelize.query("select * from user where user.age=::age",
{替换:{年龄:20}});
为什么他使用双冒号而不是单冒号?
最佳答案
查看 docs 似乎您需要一个冒号。替换可以使用冒号命名,也可以使用问号命名。例如
sequelize.query("select * from user where user.age=:age", {replacements:{age:20}});
或者
sequelize.query("select * from user where user.age=?", {replacements:[20]});
关于node.js - 使用sequelize的sql中双冒号的用法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34740624/