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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:16:01+00:00 2026-05-15T19:16:01+00:00

If I am creating temporary tables, that have 2 columns. id and score .

  • 0

If I am creating temporary tables, that have 2 columns. id and score. I want to to add them together.

The way I want to add them is if they each contain the same id then I do not want to duplicate the id but instead add the scores together.

if I have 2 temp tables called t1 and t2

and t1 had:

id 3 score 4
id 6 score 7

and t2 had:

id 3 score 5
id 5 score 2

I would end up with a new temp table containing:

id 3 score 9
id 5 score 2
id 6 score 7

The reason I want to do this is, I am trying to build a product search. I have a few algorithms I want to use, 1 using fulltext another not. And I want to use both algorithms so I want to create a temporary table based on algorithm1 and a temp table based on algorithm2. Then combine them.

  • 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-15T19:16:02+00:00Added an answer on May 15, 2026 at 7:16 pm

    How about:

    SELECT id, SUM(score) AS score FROM (
      SELECT id, score FROM t1
      UNION ALL
      SELECT id, score FROM t2
    ) t3
    GROUP BY id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read that creating a temporary table is best if the number of
I have a temporary table I'm creating in a sproc that houses my user
If you're creating a temporary table within a stored procedure and want to add
Creating liquid layouts is an immense pain. Now, I totally understand that tables should
Will there any conflict while creating temporary tables of Same name in MySql from
Say I have a table transactions that has columns acct_id trans_date and trans_type and
I am trying to use a prepared statement that deletes from two (temporary) tables:
I have a query that I execute with CREATE TEMPORARY TABLE AS SELECT because
Based on a post I've seen. I am creating a temporary array elements by
Creating my WordPress author.php template page and ran into a little roadblock. I want

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.