sequelize where not exist查询

ubof19bj  于 2021-06-17  发布在  Mysql
关注(0)|答案(0)|浏览(247)

我刚从laravel转到nodejs,我正在使用sequelizeMap到mysql数据库,我一直在尝试将sql查询转换成sequelize

select * from `messages` where ((`to` = ? and `from` = ? and `recipient_type` = ? and `timer` is null)) or ((`to` = ? and `from` = ? and `recipient_type` = ? and `timer` is null)) and not exists (select * from `message_deletes` where `messages`.`mid` = `message_deletes`.`message_id` and `user_id` = ?) order by `id` desc limit 100

有人能帮忙吗。谢谢您

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题