0
我試圖做到這一點在sequelizeSequelize concat在where子句中?
SELECT * FROM tbl_person as p,tbl_employee as e
WHERE CONCAT(p.first_name,' ',last_name) = full_name;
我怎麼可以轉換它sequelize的JavaScript?
謝謝你提前。
我試圖做到這一點在sequelizeSequelize concat在where子句中?
SELECT * FROM tbl_person as p,tbl_employee as e
WHERE CONCAT(p.first_name,' ',last_name) = full_name;
我怎麼可以轉換它sequelize的JavaScript?
謝謝你提前。
我以前從來沒有用過sequelize,但是在看過文檔之後,難道你不能用Sequelize.fn(...)
?
Model.findAll({
where: Sequelize.where(
Sequelize.fn("CONCAT",
Sequelize.col("first_name"),
" ",
Sequelize.col("last_name")
),
{
eq: Sequelize.col('full_name')
}
)
});