Reputation: 134
I have the following working Distinct Interbase SQL on the two fields. I need to modify it to just return a count of these distinct records.
select distinct ap.propertyuid, ap.adjpropertyuid
from adjproperty ap
where ap.payyear = 2019
order by 1, 2
Data
propertyUID adjpropertyUID payyear
15 21 2019
15 22 2019
16 23 2019
16 23 2019
16 25 2019
17 33 2019
17 33 2019
Should return a count of five,
Upvotes: 1
Views: 203
Reputation: 296
select count(distinct ap.propertyuid || ap.adjpropertyuid)
from adjproperty ap
where ap.payyear = 2019
Upvotes: 1
Reputation: 296
something like this?:
select count(distinct ap.propertyuid), count(distinct ap.adjpropertyuid)
from adjproperty ap
where ap.payyear = 2019
order by 1, 2
Upvotes: 0