From 23b0e7cf84277e99cefb1c5d00b242d0f3f41452 Mon Sep 17 00:00:00 2001 From: valentinkolb Date: Wed, 13 Nov 2024 00:50:52 +0100 Subject: [PATCH] feat(analyticsApi): minor sql changes --- analyticsApi/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analyticsApi/main.go b/analyticsApi/main.go index 1e62999..c1622ea 100644 --- a/analyticsApi/main.go +++ b/analyticsApi/main.go @@ -227,7 +227,7 @@ func initAggregateCount(app *pocketbase.PocketBase, e *core.ServeEvent) { err := app.Dao().DB(). NewQuery(` - SELECT ` + field + ` as value, COUNT(id) AS count + SELECT IFNULL(` + field + `, 'N/A') as value, COUNT(id) AS count FROM analyticsSessions WHERE created >= {:startDate} GROUP BY ` + field).