0
Select sum(amt) as totalA from tableA where id>10;
Select sum(amount) as totalB from tableB where people = 'JOSH';
sum(totalA + totalB)
을 갖는 것이 가장 좋은 방법은 무엇입니까?DB2 두 개의 다른 테이블에서 두 개의 열을 더하는 방법
Select sum(amt) as totalA from tableA where id>10;
Select sum(amount) as totalB from tableB where people = 'JOSH';
sum(totalA + totalB)
을 갖는 것이 가장 좋은 방법은 무엇입니까?DB2 두 개의 다른 테이블에서 두 개의 열을 더하는 방법
select sum(total) from
(
select sum(amt) as total from tableA where id>10
union all
select sum(amount) from tableB where people = 'JOSH'
) as q
T-SQL을 사용할 수 있습니까? – SMA
@almasshaikh : DB2에는 "T-SQL"이 없습니다. –