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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:30:36+00:00 2026-05-25T00:30:36+00:00

I have a table with 200 columns (maybe more…) a1 a2 a3 a4 a5

  • 0

I have a table with 200 columns (maybe more…)

a1   a2   a3     a4  a5  ...a200
---------------------------------
1.2  2.3  4.4   5.1  6.7... 11.9   
7.2  2.3  4.3   5.1  4.7... 3.9   
1.9  5.3  3.3   5.1  3.7... 8.9   
5.2  2.7  7.4   9.1  1.7... 2.9  

I would like to compute many operations:

  • SUM(every column)
  • AVG(every column)
  • SQRT(SUM(every column))
  • POWER(SUM(every column),2)
  • MIN(all columns)
  • MAX(all columns)
  • GREATEST(SUM(one column) vs SUM(other column))
    something like finding wich sum is greatest for every column:

    a1 vs a2,  a1 vs a3, a1 vs a4....,a1 vs a200,
    a2 vs a1,  a2 vs a3, a4 vs a5....,a2 vs a200,  
    ...
    a200 vs a1, a200vs a2, a200vs a3.....a200 vs a199
    

If I do a single select statement for each column,and for each operation I’d have:

SELECT 
 SUM(a1),...,SUM(a200),
 AVG(Sum(a1)),...,AVG(Sum(a200)),
 POWER(Sum(a1),2),...,POWER(Sum(a200),2),
 GREATEST(SUM(a1),SUM(a2)), GREATEST(SUM(a1),SUM(a3)),...,GREATEST(SUM(a1),SUM(a200)),
 GREATEST(SUM(a2),SUM(a1)), GREATEST(SUM(a2),SUM(a3)),...,GREATEST(SUM(a2),SUM(a200))....
 GREATEST(SUM(a200),SUM(a1)), GREATEST(SUM(a200),SUM(a3)),...,GREATEST(SUM(a200),SUM(a199))
 etc... FROM tabMultipleColumns

The problem here is when I do a query with more than 1024 possible results
aka, >= 1024 columns

Is there a way to keep doing massive operations with data doing a single scan of the table, I mean avoiding doing multiple selects statements?

I am trying to use only a scan, because if the table is huge (with size
of many GB’s) using many selects statements to scan the same table would be expensive…

Can a tool like BCP be used or what solution do you think is more efficient…

if you look only for the SUM, POWER(SUM(),2) and SQRT(SUM()), there are 600 result columns… if I keep doing this operations there are more than 1024…

  • 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-25T00:30:36+00:00Added an answer on May 25, 2026 at 12:30 am

    That’s a lot of calculations. I would probably just do a periodic dump of them into another table to minimize server load. It depends on how often the query is going to be used though.

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

Sidebar

Related Questions

I have written PLSQL program that generates table having usually more than 200 columns.
I have a user profile table with columns User Name , Manager and many
I have table named 'Dictionary' with columns as follow: ID bigint TYPE varchar (200)
I have a small (200 rows / 400kb) table with 4 columns - nvarchar(MAX),
I have a score table that contains two columns: user_id and score user_id    score 1               200
i have a table with about 200,000 records. i want to add a field
I have table with 50 entries (users with such details like Name Surname Location
I have table with 3 columns A B C. I want to select *
I have a table x that's like the one bellow: id | name |
Suppose I have a table with columns (DayId, RunningTotal): DayId RunningTotal --------------------- 1 25

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.