fix: remove nested aggregate in claim_strength materialized view
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
e1ab6e4ad1
commit
537f01770c
|
|
@ -78,10 +78,11 @@ SELECT
|
|||
NULLIF(COUNT(DISTINCT a.id)::float, 0),
|
||||
0
|
||||
) AS net_sentiment,
|
||||
MAX(GREATEST(
|
||||
COALESCE(MAX(a.created_at), c.created_at),
|
||||
COALESCE(MAX(e.created_at), c.created_at)
|
||||
)) AS last_activity
|
||||
GREATEST(
|
||||
MAX(a.created_at),
|
||||
MAX(e.created_at),
|
||||
c.created_at
|
||||
) AS last_activity
|
||||
FROM claims c
|
||||
LEFT JOIN attestations a ON a.claim_id = c.id
|
||||
LEFT JOIN evidence e ON e.claim_id = c.id
|
||||
|
|
|
|||
Loading…
Reference in New Issue