Skulle det inte fungera bara genom
select distinct username, tweet, date order by date desc
(Detta är MSSQL-syntax)
Med ny data i handen:
SELECT DISTINCT tweets.username, content, date from tweets
WHERE user_id IN (
SELECT users.id FROM users
INNER JOIN user_users ON users.id = user_users.followed_user_id
WHERE user_users.user_id = 1)
ORDER BY date desc