I am a newbie to Cache and we are using dBeaver product to query against Cache tables.
I have the following query which does a GROUP BY to aggregate the columns:
SELECT PtNumber,cpt4_OVR,CollDateODBC, COUNT(*)
FROM site.MGBILL_View
WHERE cpt4_OVR IN ('36415', '36416')
--AND ChargeFlags = '0'
AND CollDateODBC > DATEADD(DAY,-45,CURRENT_DATE)
GROUP BY PtNumber,cpt4_OVR, CollDateODBC
HAVING count(*) > 2
-This returns a count of 3 for each patient (aggregated)
But I need to display the actual 6 rows. I would typically do this by replacing the GROUP BY with an OVER(PARTITION BY