如何在续集中执行这样的SQL查询?
SELECT id
FROM table
WHERE REPLACE(`name`,' ','') LIKE '%$name%'.
谢谢。
答案 0 :(得分:0)
我还没有测试过,但是根据the documentation,这应该可行。
sequelize.query('SELECT id FROM table WHERE (`name`,' ','') LIKE :search_name ',
{ replacements: { search_name: '%$name%' }, type: sequelize.QueryTypes.SELECT }
).then(ids => {
console.log(ids)
})