Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 697993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:13:33+00:00 2026-05-14T03:13:33+00:00

Basically a live feed of all your friends’ recent posts. In a stupid sort

  • 0

Basically a live feed of all your friends’ recent posts.

In a stupid sort of approach I think I’d start by building a query like:

SELECT * FROM tblposts WHERE userid=friend_id_1OR userid=friend_id_2...... and so on

Where friend_id_% is the userid of a friend from your friends list. But this must be a very inefficient way of doing it, right? Is there any faster way of doing this in MySQL? Maybe some clever DB schema?

(I know FB uses Hadoob but I’m not experienced enough to go that far 🙁 )

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:13:34+00:00Added an answer on May 14, 2026 at 3:13 am

    If you have a list of IDs that you want to query then you should use IN:

    SELECT * FROM tblposts WHERE userid IN (friend_id_1, friend_id_2, ...)
    

    But in this case I think you can use a join instead.

    SELECT * FROM tblposts AS T1
    JOIN (
       SELECT friendid             -- I just made up this query.
       FROM friends                -- You need to replace it with the
       WHERE userid = 'youruserid' -- real query to get someone's friends.
    ) AS T2
    ON T1.userid = T2.friendid
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So basically I'm attempting to make an interactive live wallaper that basically displays your
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
I've tried many jQuery twitter feed plugins and they all seem to suffer from
We currently have a Live ASP.NET application (Basically a CMS) running on our IIS7
We basically need to be able to adjust behaviour at start-up time, by providing
Looking to add a live, scrolling twitter feed (of my own tweets only) to
So I'm trying to make a live feed essentially, and my code is shown
Basically, I have a live search that is working for the two out of
Skip to live example. So basically I have a <div> that has a fixed
How to create a Live CHat application in JSP. Basically i am creating a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.