c# - How to implement tag counting -


I have my tag like this in my database:

  table: item column : Item IDID, Title, Content Table: Tag Col: Tag ID, Title Table: Item Tag Column: Item ID, Tag ID / Example - This is the right Sidebar of StackWorflow C ## 59279 Squared × 14885 ASPN-MVC × 9123 links × 4337 Tag × 33 9  

If I want to know the count of each tag such as the Stackoverflow flow tag How do I do to it?

In the table tag, a type of query that I will display, I am open to both regular SQL and Linux Add more columns, which work as a counter when you add or remove a tag from an object, you update that counter (in other words, when on the item tag to increase the contact on the tagged item Line, then the counter decreases)

items Add tags:

Enter item tags (item, tag) value ('$ itemid', '$ tagid'); Upload tag SET counter = counter + 1 WHERE tagid = '$ tagid'; Remove

tag from item

  item tag where item id = '$ itemid' and tagid = '$ tagid'; Upload tag SET counter = counter-1 WHERE tagid = '$ tagid';  

Recover item tags with counter

  select t.title, t.counter item tags as t.idtag = It.tagid at WHERE it.itemid = '$ itemid'  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -