I want to get debtors from numbers from TOP 3 partitions. I am using this query to select partitions:
use select top 1 code, data_container_alias from systempartitions@datadictionary where data_container_alias = 'nmbrs'
And this query to get debtors:
select *
from Debtors@nmbrs de
order
by de.id
End result: I get a lot of Debtors (say > 1.000) but it doesn't depend on how many partitions I select.
What I am trying to achieve is to get a debtor companies list using this query
select de.PartitionID
, de.ID
, de.Number
, de.Name
, de.PhoneNumber
, de.FaxNumber
, de.Email
, de.LoonaangifteTijdvak
, de.KvkNr
, d.ID as DebtorID
from Debtors@nmbrs d
full
outer
join DebtorCompanies(d.ID)@nmbrs de
order
by de.PartitionID
But my end result is cartesian product of (all Debtors) X (all Partitions/Companies)
How can I get debtors for specific partitions and companies? Is there a reason why partitions are at a company and not a debtor level?