当我使用 Invantive Data Hub 从多个 Exact Online 公司下载数据时,当我希望每个公司有一行时,我会得到重复的行。
我使用以下查询:
select gla.code
, gla.description
, gla.division
, glc.glclassification_code_attr
, glc.glclassification_description
, glc.division_code
from ExactOnlineREST..GLAccounts gla
join ExactOnlineXML..GLAccountClassifications glc
on gla.code = glc.GLCLASSIFICATIONLINKS_GLACCOUNT_CODE_ATTR
and gla.division = glc.division_code
where gla.code = '4001'
and gla.division = 12345
我期望返回的结果是 1 行,但查询检索到 12 行。
来自单独表的单个查询确实给出了 1 行的预期结果。例如:
select glc.glclassification_code_attr
, glc.glclassification_description
, glc.GLCLASSIFICATIONLINKS_GLACCOUNT_CODE_ATTR
, glc.division_code
from ExactOnlineXML.XML.GLAccountClassifications glc
where glc.GLCLASSIFICATIONLINKS_GLACCOUNT_CODE_ATTR = '4001'
and glc.division_code = 12345
和:
select gla.Code
, gla.Description
, gla.Division
from ExactOnlineREST..GLAccounts gla
where gla.code = '4001'
and gla.division = 12345
如何确保组合查询只返回 1 行,如预期的除法 12345?