mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
add NULLIF in group statement because of go null values = empty string
This commit is contained in:
parent
e2294c4b6c
commit
50c0d9ccd0
@ -44,9 +44,9 @@ func (db *sqlstore) GetAggregatedReferrerStats(startDate time.Time, endDate time
|
||||
WHERE date >= ? AND date <= ? `
|
||||
|
||||
if db.Config.Driver == "sqlite3" {
|
||||
sql = sql + `GROUP BY COALESCE(groupname, hostname || pathname ) `
|
||||
sql = sql + `GROUP BY COALESCE(NULLIF(groupname, ''), hostname || pathname ) `
|
||||
} else {
|
||||
sql = sql + `GROUP BY COALESCE(groupname, CONCAT(hostname, pathname) ) `
|
||||
sql = sql + `GROUP BY COALESCE(NULLIF(groupname, ''), CONCAT(hostname, pathname) ) `
|
||||
}
|
||||
sql = sql + ` ORDER BY pageviews DESC LIMIT ?`
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user