我想知道使用Sequelize执行此请求所要编写的代码:
select * from "Songs"
where Id in (
select "songId" from "Likes"
where "userId"=1
)
Songs.findAll({
attributes: {
include: [
[
// Note the wrapping parentheses in the call below!
sequelize.literal(`(
select "songId" from "Likes"
where "userId"=1
)`),
'SongId'
]
]
}
});
您可以尝试上面的内容作为参考参见此处