sequelize 怎么实现 (AllTestID,ChildTestID) in((2000591,-1),(9002339,9000207))
比如 大题ID(AlltestID) 小题ID (ChildtestID) sql 语句是 select * from test where userID =1 and (AllTestID,ChildTestID) in((2000591,-1),(9002339,9000207)) 用sequelize 实现上面的sql 怎么实现
2 回复
使用Sequelize.literal
where: {
[Sequelize.Op.and]: [{ userID: 1 }, Sequelize.literal(`(AllTestID,ChildTestID) in((2000591,-1),(9002339,9000207))`) ],
}
谢谢, 可以了