获取用户自己喜欢的帖子列表的查询是什么?
是的,我知道用户“喜欢”自己的帖子是不寻常的,但这就是我正在寻找的。我还知道您无法按用户查询类似的表来获取他们喜欢的所有内容,但这不是我想要的。我只想要他们喜欢的自己的帖子(以及后来的照片)。
我的 SQL 技能显然已经变得生疏了——根据我发现的例子来玩弄语句:
SELECT source_id,message,created_time FROM stream WHERE source_id=me()
我
SELECT actor_id, post_id, message FROM stream WHERE uid IN (SELECT uid2 FROM like WHERE uid1=me())
想我想要做的事情要么微不足道,要么目前不可能。我希望是前者。
Yes, I know that it's unusual for a user to "like" their own posts but that's what I'm looking for. I also know that you can't query the like table by user to get everything they've liked but that's not what I'm after. I just want their own posts (and later, photos) that they've liked.
I've clearly gotten pathetically rusty in my SQL skills--playing around with statements based off of the examples I've found:
SELECT source_id,message,created_time FROM stream WHERE source_id=me()
and
SELECT actor_id, post_id, message FROM stream WHERE uid IN (SELECT uid2 FROM like WHERE uid1=me())
I imagine what I want is either trivial to do or currently impossible. I expect the former.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要获取用户喜欢的帖子 ID,可能类似于:
您可以将其扩展为也包括照片 ID。您可以使用类似的 post_id 字段将其嵌套到另一个深度以获取更多帖子信息。
To get the post ids that the user likes, it would be something like:
You could expand this to also include photo ids. And you could nest it another level deep to get more post info by using the like's post_id field.