I\'m trying to do a query that fetches data per hour but instead of the normal group by hour I want to narrow it down and only get the latest hour
Do you mean one hour from NOW or latest full hour? If it's latest full hour something like this might work?
SELECT userid, username, date_created
FROM user_accounts
WHERE HOUR(date_created) = (SELECT HOUR(date_created) FROM user_accounts ORDER BY date_created DESC LIMIT 1);
EDIT: Ahhh, now I think I get what you want... The last added entry on every given hour between your date range?
If so then Codler's query is what you want.