How to SUM two fields within an SQL query

0 votes

The sum of two fields that are in the same row must be obtained, and that number must be entered in a field at the end of the same row.

This is my code.

Sum(tbl1.fld1 + tbl1.fld2) AS [Total]

Is this the purpose of the SUM function, or can it also be used to calculate a column's sum?

Sep 5 in Database by Kithuzzz
• 12,240 points
39 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
1 answer

How to run a SQL query on an Excel table?

On Excel tables, how to construct and ...READ MORE

answered Apr 11 in Database by gaurav
• 18,960 points
167 views
0 votes
1 answer

What is the SQL query to get the third highest salary of an employee from employee_table

You can try out something like this: SELECT ...READ MORE

answered Sep 27, 2018 in Database by Sahiti
• 6,380 points
7,595 views
0 votes
1 answer

How to schedule a job for SQL query to run daily?

down voteaccepted Expand the SQL Server Agent node ...READ MORE

answered Oct 25, 2018 in Database by Frankie
• 9,830 points
8,246 views
0 votes
1 answer

How to schedule a job for sql query to run daily?

Hii, To schedule a job for sql query ...READ MORE

answered May 4, 2020 in Database by Niroj
• 82,780 points
1,052 views
0 votes
1 answer

How to drop all tables from a database with one SQL query?

Use the INFORMATION_SCHEMA.TABLES view to get the ...READ MORE

answered Feb 4 in Database by Neha
• 8,920 points
315 views
0 votes
0 answers

How to convert date into timestamp in SQL query?

I'm attempting to move data from the ...READ MORE

Aug 19 in Database by Kithuzzz
• 12,240 points
36 views
0 votes
0 answers

How to see the real SQL query in Python cursor.execute using pyodbc and MS-Access

I use the following code in Python ...READ MORE

Sep 4 in Database by Kithuzzz
• 12,240 points
16 views
0 votes
1 answer

Which query to use for better performance, join in SQL or using Dataset API?

DataFrames and SparkSQL performed almost about the ...READ MORE

answered Apr 19, 2018 in Apache Spark by kurt_cobain
• 9,390 points
1,000 views
0 votes
1 answer

How to connect Java program to the MySQL database?

You can connect your Java code with ...READ MORE

answered May 11, 2018 in Java by Parth
• 4,630 points
935 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP