add query for registrations

This commit is contained in:
Pritimay Sarkar
2023-11-08 14:00:05 +05:30
parent a93c7e5976
commit 2e4ba04fe9

View File

@@ -0,0 +1,6 @@
SELECT DATE(PARSE_TIMESTAMP('%Y-%m-%d %H:%M:%S', REPLACE(JSON_EXTRACT(P.data, '$.createdAt'), '"', ""))) AS creation_dates, COUNT(DISTINCT JSON_EXTRACT(P.data, '$._id')) AS creation_count
FROM `hpos-prod.firestore_export.patientData_raw_latest` AS P
WHERE JSON_EXTRACT(P.data, '$.createdAt') <> '""'
GROUP BY creation_dates
ORDER BY creation_dates DESC
LIMIT 7