\pset pager off
\pset tuples_only on
\pset fieldsep '\t'
SELECT 'today_grp97', count(*), error_message, coalesce(account_id,0), coalesce(upstream_status_code,0)
FROM ops_error_logs
WHERE created_at >= TIMESTAMPTZ '2026-05-12 00:00:00+08' AND created_at < now()
  AND group_id=97
GROUP BY 3,4,5 ORDER BY 2 DESC LIMIT 20;
SELECT 'key1273_now', k.id, k.name, k.status, k.group_id, k.quota, u.email FROM api_keys k LEFT JOIN users u ON u.id=k.user_id WHERE k.id=1273;
