我有一个表posts
其中用户所有的职位都存储,该表的结构如下查询来获取从人用户是继转播
| post_id | post_user | post_content | post_date |
用户表如下
| user_id | username | user_joined |
用户关系表如下
| follower | following | rel_date |
这是查询我一个m用于从用户关注的人员中获取帖子以显示他们的帖子。
SELECT * FROM posts WHERE post_user in(SELECT follower from user_follow where following=$loggedin_user)
现在,我希望用户如下
| repost_user | original_post_user | post_id | repost_date |
我想从人的用户以下,其中包括转播过帖子分享信息,为此,我创建了一个表repost_user ..我该怎么做呢?
编辑:如何我的结果集应该
post_id | post_content | post_user | post_date | is_repost | repost_user | repost_date
对于例如,如果正常交行应该像
23 | <some content> | 3 | <post date> | false | null | null |
如果其重新发布行会
23 | <some content> | 3 | <post date> | true | 2 | <repost_date> |
感谢@jaczes,请看看这个问题,我有什么编辑它,我多么想成为结果集... –
小更新....更好? – jaczes