I have a select query which is suppose to return news which is connected to several team ids. For this i'm using the IN statement with the selected team ids. For instance in this case i've chosen the teams with the id's 1 and 2 as you can see
The issue is that the teams might be connected to the same news and therefor i dont want duplicates of the same news? How can i make sure that there are not duplicate news even though the teams might be connected to the same news?
SELECT news.id,
news.title,
news.url,
news.image_url,
news.date,
news.news_text,
website.url AS website_url,
website.image AS website_image
FROM news,
team,
contain,
website
WHERE team.id IN ( 1, 2 )
AND news.website_id = website.id
AND team.id = contain.team_id
AND contain.news_id = news.id
ORDER BY news.date DESC
LIMIT 0, 30