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

  • Home
  • SEARCH
  • 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 4027130
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:03:30+00:00 2026-05-20T11:03:30+00:00

I have a table with various fields 2 of which contain a number between

  • 0

I have a table with various fields 2 of which contain a number between 1 and 50.

I need help setting up a script that will automatically take two set fields add them and insert the total into a third field for each indivdual record for all records in the table.

I’m stuck in creating this because some records will have 0 or NULL values.

Please help 🙂

I’ve think I may be able to do this purely in SQL but the closest i found was this:

Alter table Mytable add column Keywords varchar(255);
update Mytable set Keywords = concat(Categories, ' ', Tags);

Obviously I would not need to add the column etc. Either a PHP or SQL solution would be fantastic.

Example in case I’mm not explaining this well it’s confusing me a lot

Column 1 - Field Value: 20
Colum 2 - Field Value 20
Add Colum 1 + Colum 2 = 40
Insert 40 into Colum 3

Thanks

  • 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-20T11:03:30+00:00Added an answer on May 20, 2026 at 11:03 am

    This should do it

    UPDATE [TABLE_NAME] SET col3 = [TABLE_NAME].col1 + [TABLE_NAME].col2;
    

    Replace [TABLE_NAME] and col1, col2, col3 with your tables and columns

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

Sidebar

Related Questions

I need to store a large table (several millions or rows) that contains a
I have a model Task which will HABTM many TaskTargets. When it comes to
I have a string in my code which concatenates email addresses from various tables
I have content table where I have many contents and various versions of those
I have a stored procedure which selects a single field from a single row
I have to maintain an application that has a lot of columns that are
I have two xsl file each for different type of machines for various unix
I have a table, say example1 and I'm using a jdbc statement to delete
Suppose I have a table called Transaction and another table called Price. Price holds
I have this big table called StateChanges (1.9 million rows) from a third party

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.