gpt4 book ai didi

node.js - 我如何在 Sequelize 中做到这一点?

转载 作者:行者123 更新时间:2023-12-03 22:41:37 24 4
gpt4 key购买 nike

SELECT client_name,mid_number,user_name,PASSWORD 
FROM automation_run_log
WHERE LENGTH(schedule_status="FAILED") > 0
GROUP BY client_name

我的代码:
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)
})

在 where 子句中我在哪里给出 $gt:0

最佳答案

我没有时间尝试,但这应该有效:

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)
})

关于node.js - 我如何在 Sequelize 中做到这一点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41606173/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com