a tricky situation
Posted: Wed Sep 26, 2007 12:58 pm
hi all
I am stuck into a tricky situation and i need your help to get out of that.
I am working on a system which has a multicategories system and each article can be assigned to more than one category. For that I am storing all category ids separated by commas against articleid like below:-
artcleid | categoryids
1 | 45,56,78
2 | 67,98,34
I am updating current system which used to have one on one relationship between categories and articles.
Now there are some queries that need updating. one such query is "select * from articles where categoryids < 100"
Now I am quiet confused on how should i update this query so that it fits current db structure. Basically i should check all category ids in categoryids field which have atleast one value which is less than 100.
I hope you understand my problem. any help will be highly appreciated.
Regards
Mike
I am stuck into a tricky situation and i need your help to get out of that.
I am working on a system which has a multicategories system and each article can be assigned to more than one category. For that I am storing all category ids separated by commas against articleid like below:-
artcleid | categoryids
1 | 45,56,78
2 | 67,98,34
I am updating current system which used to have one on one relationship between categories and articles.
Now there are some queries that need updating. one such query is "select * from articles where categoryids < 100"
Now I am quiet confused on how should i update this query so that it fits current db structure. Basically i should check all category ids in categoryids field which have atleast one value which is less than 100.
I hope you understand my problem. any help will be highly appreciated.
Regards
Mike