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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:45:25+00:00 2026-05-28T15:45:25+00:00

I have many tables.But there are Two columns common in each table. They are

  • 0

I have many tables.But there are Two columns common in each table.
They are RegNo and Total.Now i want the values of all the total column for a particular RegNo.
I can get that in different queries like this.

query=from k in db.MyTable1 where K.regNo=1 select k.Total
query2=from k in db.MyTable2 where K.regNo=1 select k.Total

This way but i want to do this and get the Summation of all Total’s Column using one single Query
Please guide.

  • 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-28T15:45:26+00:00Added an answer on May 28, 2026 at 3:45 pm

    You can do it this way.

       var itemCounts = (from k in db.MyTable1 where k.RegNO==1 select k.Total)
                         .Union(from k in db.MyTable2 where k.RegNO==1 select k.Total);
           TotalOfAll=itemCounts.Sum();
    

    and using the sum method you can get the summation of all the Values in the query.

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

Sidebar

Related Questions

I have many tables with identical schemas but different names. Can I create a
I have many tables, say T1, T2, T3. Every table has a column named
I have some tables that benefit from many-to-many tables. For example the team table.
So I have two tables. Table1 have two columns, col1 and col2, where col1
I have two tables with a variable amount of columns. (I don't know how
I am trying to pull multiple columns from 3 joined tables, but I want
I have two tables, House and Person . For any row in House, there
I have two tables Table1 and Table2. There are 10 fields in Table1 and
We have two tables, ActivityForm and Field which are given a many-to-many relationship via
I have two tables, entities and components, each with a name and unique ID.

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.