我的桌子:
feeds_time:
user_id | time
1 | 123123
2 | 1231111
3 | 1233223
...
users_follow
user_id | follow_id
1 | 2
1 | 3
2 | 3
和表格帖子 - 但这在这个问题中并不重要。
实际上我的查询看起来像:
SELECT `id`, `name`, `user_id`, `time`, 'posts' as `what`
FROM `posts`
WHERE `user_id` IN (SELECT `follow_id`
FROM users_follow WHERE user_id = posts.user_id)
现在,我想添加一个 WHERE: WHERE posts.time > feeds_time.time
by "current" user_id
。
我该怎么做?