SQL select based on Boolean values
-
I have a large number of articles. I have a large number of possible keywords. Each article has at least one keyword associated with it, but may have many keywords. There is a database containing a list of all articles and a boolean variable set to true for each keyword if that keyword applies. A user has a list of all keywords and selects those which interest them. I am trying to find a more elegant way to extract the list of relevant articles than a brute force SQL SELECT. Any suggestions would be appreciated!
-
I have a large number of articles. I have a large number of possible keywords. Each article has at least one keyword associated with it, but may have many keywords. There is a database containing a list of all articles and a boolean variable set to true for each keyword if that keyword applies. A user has a list of all keywords and selects those which interest them. I am trying to find a more elegant way to extract the list of relevant articles than a brute force SQL SELECT. Any suggestions would be appreciated!
I guess you will not be able to escape from a select statement...maybe you could try to use a stored procedure for that, or try to optimize the select, but not without a select I think
Intelligence is almost useless for those who have nothing else! Email: caiokf@gmail.com
-
I have a large number of articles. I have a large number of possible keywords. Each article has at least one keyword associated with it, but may have many keywords. There is a database containing a list of all articles and a boolean variable set to true for each keyword if that keyword applies. A user has a list of all keywords and selects those which interest them. I am trying to find a more elegant way to extract the list of relevant articles than a brute force SQL SELECT. Any suggestions would be appreciated!
I think your database design is not ideal.. You should have a table for all the articles and a table for all possible keywords. In a third table you save all keyword-article associations (using the primary key of the article and keyword).