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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:01:40+00:00 2026-06-02T08:01:40+00:00

I need to sum the totals of a row except the first column. Something

  • 0

I need to sum the totals of a row except the first column.
Something similar too:

SELECT SUM( col2 + col3 + col4 +colN)
FROM numbers
WHERE user_name = ‘person’;

My table will continuously have columns added to it. So I want it to automatically pick up the sum of the new columns too without it needing to be hard coded into the query?

user_name  | Col | col2 | Col3 | Col4 + other columns.

person1    |  2  |  3   | 76   | 56  etc.    ---------> sum of row

person2    |  6  |  72  | 200  | 13  etc.    ---------> sum of row

Thanks in advance for any help!

  • 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-02T08:01:43+00:00Added an answer on June 2, 2026 at 8:01 am

    Not wishing to ‘avoid’ the question, but it looks like you could do with having a different data structure.

    You should consider having a ‘users’ table with columns for id and user_name, and a new table (e.g. properties) with a row for each of the other columns in your current table (Col1, Col2 … ColN). The new table would then have a column for user_name to link it to the users table.

    That way you’d be able to do something like:

    SELECT SUM(property_column) FROM properties WHERE user_name = <RequiredUserName>
    

    I’d also recommend selecting users by ID (i.e. have the properties table with a user_id column, rather than a user_name column), unless you’re confident that a user_name is never going to change (and even then…).

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

Sidebar

Related Questions

I have multiple tables that need to be merged into one. SELECT name, SUM(money)
I need to sum some rows applying on each row a formula and after
I found some really good sum row, sum column of drop down examples, but
I am using SSMS 2008, trying to select just one row/client. I need to
I need to query this DB to get each row, but also the SUM
I'm trying to select the SUM of a row where the ID matches a
I need to select 10 or less rows with the SUM(FileSize) < 1000000. Results
I need to sum the hours worked. I have 2 fields: startTime and endTime
I need to find the sum of the ranks from 13 cards that a
I need sphinx to sort the results by the sum of an attribute. I

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.