OK I have two tables in my database and basically it has a one-to-many relationship. Lets use the following tables as an example:
news_table
- newsID
- newsDate
- newsText
news_os
- newsID
- OS
news_os will have the news_table's news ID and the OS' assigned to that news item. So, in news_os I could have multiple rows with the same newsID, but each newsID,OS will be unique (hope that makes sense).
Basically I am trying to do a query where I could say. Get me all the newsID's from news_os WHERE OS = 'Linux' AND OS='FreeBSD'
In otherwords, lets say we had the following rows in news_os
1, FreeBSD
1, Linux
2, Linux
The query would only pull out rows 1 & 2 because the newsID has both FreeBSD AND Linux assigned to it.
I have looked at JOIN etc, but im confused as to the logic and cannot get the proper result. Please advise.
Thanks.