I'm wondering if anyone can help me to solve the problem that I meet. :)
I have a table with articles, named article
and also I have a table commonarticletechnique
where I save all the techniques that can be used by reporters to compose an article. Also I have a table articletechnique
where I have references between articles and common articles techniques. Sorry for my english, I'm not a native english speaker. So my situation looks like:
Article
(Id
,Many other fields...
)
CommonArticleTechnique
(Id
, Name
, Description
)
ArticleTechnique
(Id
, FkArticleId
, FkCommonArticleTechnique
)
For example I can have in tables things like:
- in
article
an article with id 282; - in
commonarticletechnique
all kind of techniques used by users to write an article; - in
articletechnique
i can have
1, 282, 12
2, 282, 13
3, 282, 14
So, with these records, I can say that article with id 282 have 3 techniques of conception.
In UI I have a section where users can search in my database and they can check none, one, ore more article techniques. So if I want to find an article that is based on techniques 12, 13, 14 I have to write an mysql query to get all the articles that are matching exactly
with my techniques.
In my example if user select 12, 13 techniques, mysql shouldn't return the article 282. In this case the problem that rises up is bounded by the intersection of two mysql subsets. One of them is from a collection extracted from a table and the other subset is from UI, from what's the selection of users.
Please tell me if know how to write the mysql query and also it is very helpfully to not implement a stored procedure.
Thanks for all, Aryliah.