Node.js 在sequelize中如何实现这一点?
我的代码:Node.js 在sequelize中如何实现这一点?,node.js,sequelize.js,Node.js,Sequelize.js,我的代码: SELECT client_name,mid_number,user_name,PASSWORD FROM automation_run_log WHERE LENGTH(schedule_status="FAILED") > 0 GROUP BY client_name 在Where子句中,我应该在哪里给出$gt:0?我没有时间尝试,但这应该可以: automationRunLog.findAll({ attributes : ["clientName","m
SELECT client_name,mid_number,user_name,PASSWORD
FROM automation_run_log
WHERE LENGTH(schedule_status="FAILED") > 0
GROUP BY client_name
在Where子句中,我应该在哪里给出
$gt:0
?我没有时间尝试,但这应该可以:
automationRunLog.findAll({
attributes : ["clientName","midNumber","userName","password"],
where : sequelize.where(sequelize.fn('length', sequelize.col('schedule_status')),"FAILED"),
group : ['clientName']
}).then(function (clientDtls) {
console.log(clientDtls)
})
automationRunLog.findAll({
attributes : ["clientName","midNumber","userName","password"],
where : sequelize.where(sequelize.fn('length',
sequelize.col('schedule_status')),"FAILED", {$gt: 0}),
group : ['clientName']
}).then(function (clientDtls) {
console.log(clientDtls)
})