我將如何加入以下表格以給出所有表格的總計數。加入表格和總計
select (BatchIdentifier),
Count(distinct BatchIdentifier) as ERTBatchCheckIdentifier
from ERTBatchChecks
Group By BatchIdentifier
select (ERTBatchNumber),
Count(distinct ERTBatchNumber) as ERTBatchNumber
from ERTClaims
Group By ERTBatchNumber
select (BatchIdentifier),
Count(distinct BatchIdentifier) as ERTBatchesIdentifier
from ERTBatches
Group By BatchIdentifier
總計什麼?所有記錄,組或...? BatchIdentifier和ERTBatchNumber在表中有相同的值,所以分組應該跨表?你能發佈一些樣本數據和預期結果嗎? –