How can you add the data from two columns in SQL?

In SQL, the + operator can be used to add the data of two columns. Assuming there is a table with columns named column1 and column2, you can use the following statement to add them together:

SELECT column1 + column2 AS sum
FROM table_name;

The alias for the sum result can be adjusted as needed.

广告
Closing in 10 seconds
bannerAds