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 7819867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:05:46+00:00 2026-06-02T07:05:46+00:00

I’m trying to preform a SELECT query that grabs data from two tables only

  • 0

I’m trying to preform a SELECT query that grabs data from two tables only if certain data does not exist in a third table. Here are the three tables:

Blogs

id   |   blog_name

Featured Feeds

id   |   blog_id

Subscriptions

id   |   member_id   |   blog_id

I want to return the blog_id and blog_name of those listed in the Featured Feeds table, but exclude Featured Feeds that the user (member_id) is already subscribed to in the Subscriptions table. Here is the query I have thus far (using 3 for the member_id – please note the table names are slightly different than above):

SELECT featured_feeds.blog_id, featured_feeds.category_id, blogs.blog_name FROM featured_feeds LEFT JOIN blogs ON featured_feeds.blog_id = blogs.blog_id LEFT JOIN subscriptions ON subscriptions.blog_id = featured_feeds.blog_id WHERE subscriptions.blog_id != '3' ORDER BY blogs.blog_name ASC

This query doesn’t exclude the Featured Feeds that the user is subscribed to if another user is subscribed to the same feeds. For example, if Subscriptions table had the following rows:

1   |   3   |   4
2   |   2   |   4

If blog_id 4 is listed in the featured feeds, my query will still return that blog_id due to the second row of data above. Do I need to use a GROUP?

Thanks in advance!

  • 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-06-02T07:05:49+00:00Added an answer on June 2, 2026 at 7:05 am
    SELECT b.id, b.blog_name
    FROM blogs b
    INNER JOIN featured f on f.blog_id = b.id
    WHERE b.id NOT IN (SELECT id FROM subscriptions WHERE member_id = 3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I need a function that will clean a strings' special characters. I do NOT
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

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.