排序不存在的查询

时间:2018-12-14 11:19:14

标签: javascript mysql node.js sequelize.js

我刚刚从laravel转移到nodejs,并且我正在使用sequelize映射到我的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

有人可以帮忙吗?谢谢YOu

0 个答案:

没有答案