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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:40:10+00:00 2026-06-13T01:40:10+00:00

Table articles stores articles id ant title values. Table similar adds extra articles with

  • 0

Table articles stores articles id ant title values. Table similar adds extra articles with similar_id by matching article = similar table ID.

I’d better show output, its very hard to explain in words:

Article with id 3 -> Title3 Text3
when
Similar articles -> Title1(voteup,votedown), Title2(voteup,votedown)

because article table id = similar table id. ( 3 = 3[similar_id 1],3[similar_id 2]. )
And probably when article outputs similar articles id it has to back and take title of similar_id from first table.

–

Table Articles:

    ID     Title    text

    1      title1   text1
    2      title2   text2
    3      title3   text3

Table Similar:

    ID     Similar_ID   voteup votedown

    1          2          50      2
    2          3         1621    531
    3          1         ...     ...
    3          2         ...     ...
  • 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-13T01:40:11+00:00Added an answer on June 13, 2026 at 1:40 am

    Based on your requirements, the Similar_ID field is a red herring here and shouldn’t be included in the query:

    SELECT articles.Title, similar.VoteUp, similar.VoteDown
    FROM articles
    JOIN similar ON articles.ID = similar.ID
    WHERE articles.ID = 3
    

    And to include similar titles (although I’m not quite sure how you want the data structured), you can do this:

    SELECT articles.Title, similar.VoteUp, similar.VoteDown, similar_articles.Title AS SimilarTitle
    FROM articles
    JOIN similar ON articles.ID = similar.ID
    JOIN articles similar_articles ON similar.Similar_ID = similar_articles.ID
    WHERE articles.ID = 3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that stores articles, like the example: Article table: ID #CategoryID
Let's say you have a table which stores articles, and each article can have
i have a pictures table : pictures(articleid,pictureurl) And an articles table : articles(id,title,category) So,
I am building a system that stores articles and tags that categorize the article.
I have my date values in postdate column in articles table in sql database
This is my logic. I have an articles table and a matching images tables.
I have a table of articles with contains id,title among others. I have another
I have a database with one of the table storing articles. For every article
I have articles, stored in an article table. Some articles have one or more
I'm currently getting top rated articles by summing vote values from 'votes' table against

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.