Then I have to split the query in 3 similar ones (with same condition)?
I try:
I try:
SELECT
JSONB_AGG(TO_CHAR(finished, 'YYYY-MM-DD')) AS day
FROM words_games
WHERE finished > CURRENT_TIMESTAMP - INTERVAL '2 week'
GROUP BY day
ORDER BY day;
ERROR: aggregate functions are not allowed in GROUP BY
LINE 2: JSONB_AGG(TO_CHAR(finished, 'YYYY-MM-DD')) A...
^