我有这样的 UserComments 表:
1 | Frank | hello world
2 | Jane | Hi there
3 | Frank | this is my comments
4 | Frank | I think I need some sleep
5 | Jason | I need to buy new MacBook
6 | Jane | Please invite my new Blackberry PIN
另一方面,我有 FriendList 表包含:
1 | Jason
2 | Jane
假设我的朋友 ID 总是介于 1 和 5 之间。
而且由于弗兰克不是我的朋友,我无法看到他的评论。如何组合这样的表(ORDER BY UserComments.ID DESC):
1 | Jane | Please invite my new Blackberry PIN
2 | Jason | I need to buy new MacBook
3 | Jane | Hi there
谢谢。