Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Sql question (need to delete all tags with 1 count) database

0

48 views

Hi all I have a big tag datebase which has 100s of thousands of "1 count tag" rows

enter image description here

Is there a easy way I can remove all these rows from my datebase? deleting them one by one would take me a life time :D

Many Thanks enter image description here

asked April 14, 2011 1:02 pm CDT
posted via StackOverflow

2 Answers

3
Best answer
 
delete from tags where tag_count = 1;

Assuming the column that has the count is called tag_count since I cannot see it.

answered April 14, 2011 1:23 pm CDT
0
 

Assuming you have a Tags table that defines the tags, and a TagSummary view that shows the number of times each tag is used, you can then do a delete query:

DELETE FROM Tags
WHERE TagID IN 
    (SELECT TagID From TagSummary WHERE TagCount=1)

answered April 14, 2011 1:23 pm CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions