First, a hearty welcome to Tek-Tips. We hope your participation here will be rewarding and long standing.
Roedelfroe's solution is exactly what you want. Notice that the addition operation occurs between two operands (numeric expressions) whose values are known for that row:
Code:
select t1.id, t1.value value1,t2.value value2,[b]t1.value + t2.value[/b] valueadd from test1 t1, test2 t2
where t1.id=t2.id;
We use the SUM(<expression>) to add together values from a column:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.