a guest Sep 14th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- SELECT DISTINCT
- COUNT(DISTINCT "pms_patients"."id") AS count_id
- "pms_patients"."insurance_company_name_standardized" AS
- FROM "pms_patients"
- JOIN pms_transactions
- ON ( pms_patients.practice_id = pms_transactions.practice_id
- AND pms_patients.pms_patient_id =
- pms_transactions.pms_patient_id )
- WHERE ( pms_patients.practice_id = 5904
- AND STATUS IN ( 'A', 'Active', 'Pat', 'patient' )
- AND transaction_date BETWEEN '2016-09-14' AND '2018-09-14'
- AND transaction_type = 'Procedure' )
- AND ( insurance_company_name_standardized IS NOT NULL )
- GROUP BY "pms_patients"."insurance_company_name_standardized"
RAW Paste Data