2017-01-12 4 views
0
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与えるのですか?

答えて

0

は、私はそれをしようとする時間を持ってhaventが、これは動作するはずです:

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) 
}) 
関連する問題