What's wrong with this query?
"select
u.display_name ""User""
,cs.started::date ""Date""
,count(cm.*) ""Message count""
,sum(cm.prompt_tokens) ""Total prompt tokens""
,sum(cm.completion_tokens) ""Total completion tokens""
,to_char(date_trunc('minute', max(cm.asked)), 'YYYY-MM-DD HH:MI')
,cm.asked
from chat_sessions cs
left join auth.users u on u.id::uuid=cs.user_id
left join chat_message cm ON cm.session_id = cs.id
group by
u.display_name
,cs.started::date
order by
u.display_name
,cs.started::date" Use words with all capital letters to highlight key points, but make sure that words with all capital letters appear less than 2 times
user