SELECT actor_id, message, comments.count, comments.comment_list, likes.count, likes.sample from stream where source_id=me() and (likes.count > 0 or comments.count > 0)
==============================================
SELECT actor_id, message, comments.count, comments.comment_list, likes.count, likes.sample from stream where source_id in (SELECT target_id FROM connection WHERE source_id=me()) and (likes.count > 0 or comments.count > 0)
SELECT actor_id from stream where source_id in (SELECT target_id FROM connection WHERE source_id=me() and target_type='user')
===============================================================
select uid, name from user where uid in (
SELECT actor_id, message from stream where source_id in (SELECT uid2 FROM friend WHERE uid1=me())
)
SELECT target_id, message from stream where source_id=me()
select uid, name from user where uid in (
SELECT actor_id from stream where source_id=me())
Get user's post:
SELECT post_id from stream where source_id=me()
Get those friend's comment on user's post:
select fromid from comment where post_id in (
SELECT post_id from stream where source_id=me())
Get those friend's comment on user's posts:
select uid, name from user where uid in (
select fromid from comment where post_id in (
SELECT post_id from stream where source_id=me()))
Get those friend's that likes user's posts:
select uid, name from user where uid in (
SELECT likes.friends from stream where source_id=me()
)
Thursday, April 28, 2011
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment