0
......
.....
return myDb.myTable.rollgroup.findAll({
attributes : ['ID','GROUPNAME'],
where : {
id : {
$notIn: ? //// how to use subQuery here
}
}
}).then((getResult) => {
return getResult;
})
.......
.......
我的原始查询像这样:如何正确使用子查询的续集?
从MYGROUP毫克其中mg.ID不
它的工作,但正确的方式? – mani
另一种方法是先运行子查询以返回一个groupid的数组,然后使用第一个结果将其他查询链接到它上面。所以像'return model.findAll({attributes:['groupid'],其中:{groupid:}})。then((result)=> {next查询使用$ notIn中的结果})''。无论你喜欢什么。 –
Faz