I know that the tagging stuff has been mentioned many times, but I think the question can not be ascertained is.
From this thread
I can see the best method for setup tags
items (item_id, item_content) tags (tag_id, tag_title ) Tagmapping (map_id, tag_id, item_id) But what if I want to share a tag between two different item entities? For example, blog posts and articles (Let's not discuss if there should be separate entities or not :)) Do you do something that seems very wrong?
(Integer item ID primary key reference item, create (2000) table tag (integer tag_ id primary key) Create table tagmapping (integer item_id reference item, integer tag_ id reference tag, interrupt primary key (item_id, tag_id) table (integer item_id primary key Reference items, varchar (2000) article_content)) Then there are articles and posts in both the items and the table, and that's what the tag is.
You now Receive posts and articles in the form. If you want to retrieve them by tag, then you include them through the item if you want to get details about it, you have to do an external insertion in both the post and the paragraph, and then empty columns Must have to ignore.
You often have a column in the parent table too, the item here is like 'integer subtype anti-counter no', which is included in it, say, 1 if the item is a post, 2 If this is an article, etc. It is a bit easier to know which column to ignore, or if you want to make another query for them after a simple join, then to see the details.
Comments
Post a Comment