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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:31:45+00:00 2026-06-09T16:31:45+00:00

I have a reputation points table for my members. rep_id | mem_id | activity

  • 0

I have a reputation points table for my members.

rep_id   |   mem_id   |   activity        |   points   |   article_id   |   comment_id
---------|------------|-------------------|------------|----------------|-----------------
1        |   99       |   Posted Comment  |   5        |   10343        |   239403
2        |   99       |   Introduction    |   50       |                |
3        |   99       |   Liked Comment   |   5        |   748          |   9302

As you can see, not all reputation points have an article_id or a comment_id, but when I list these records, if the record does have an article_id, I need to grab the article_title from the blog_articles table. The same with comment_id, if it’s present, I need to grab the comment from the blog_comments table. If article_id or comment_id is missing, just print the original record as-is.

I would really appreciate if somebody could tell me which join to use for this query. I THINK, by looking at the documentation, it’s a LEFT JOIN I need, which prints all records from the left, even though there are no matches in the right – but really unsure.

I’m not looking for any code, just tell me which join is recommended and I will code it.

  • 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-09T16:31:46+00:00Added an answer on June 9, 2026 at 4:31 pm

    Left join is what you need, indeed. If the record does not have an article_id the value for article_title will be NULL. The same applies to comment_id / comment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following situation. We want an reputation table to evaluate Users And
First, why I ask: Now that reputation points on StackOverflow have real value (you
In my current web application, I have to create a Reputation Points & Badges
have 2 questions : A computer with 32-bit address uses 2-level page table (9
I have a reputation system on my site, similar to Stack Overflow, where a
I have a problem where I have a series of points for a simple,
i need some help with nsarrays and uipicker i have a table of data
Community Wiki I don't care about the reputation points, I just want good answers.
I have some points that I need to classify. Given the collection of these
When we talk about security we have the following requirements: authentication integrity Non-repudiation Isn't

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.