Hey, I'm not the biggest expert with MySQL but here is what I have so far to get the MAX entery
SELECT DISTINCT
websites.id,
websites.title,
websites.url,
websites.screenshot,
impressions.number,
blocks.price
FROM websites
LEFT JOIN blocks ON websites.id = blocks.website
LEFT JOIN impressions ON blocks.id = impressions.block
WHERE status = 1
AND blocks.active = '1'
AND impressions.number = (SELECT MAX(number)
FROM impressions)
What I want to do is SELECT the max(number) but of the sum of the last 5 entries. I've tried messing around but just can't get it.