Попробуйте агрегировать по имени, а затем проверьте отметку времени:
SELECT
name,
MAX(CASE WHEN timestamp::date = NOW()::date - INTERVAL '1 DAY'
THEN usage END) AS u_yesterday,
MAX(CASE WHEN timestamp::date = NOW()::date
THEN usage END) AS u_today,
MAX(timestamp) AS timestamp
FROM yourTable
GROUP BY
name;