I am trying to run the below query
w_provider is joined twice it only has 75k rows and the w_encounters has 57 million rows, but when ran this query to get the counts it is showing in billions.
What is the proper way to get the count.
from w_encounters encounter
inner join w_provider billing_provider
on encounter.billing_prov_npi = billing_provider.npi
inner join w_provider treating_provider
on encounter.treating_prov_npi = treating_provider.npi
Thank you very much for the helpful info.