Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to delete all comments

Author  Topic 

sharonejackson
Starting Member

3 Posts

Posted - 2012-12-10 : 12:44:58
I have a customer who has NEVER moderated her comments. She has over 13,000 of them and 99.9% are spam.

I tried this:

SELECT FROM wp_comments WHERE comment_approved = 0
planning to delete once I had gotten them all.

But the error message I got was this:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM wp_comments WHERE comment_approved = 0 LIMIT 0, 30' at line 1

Please tell me what I am doing wrong.Thanks so much!

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2012-12-10 : 12:51:15
You need to list the columns you want to select, or use a * for selecting all columns
SELECT col1,col2 FROM wp_comments WHERE comment_approved = 0
-- or
SELECT * FROM wp_comments WHERE comment_approved = 0
Go to Top of Page

sharonejackson
Starting Member

3 Posts

Posted - 2012-12-10 : 13:06:25
Thank you! I knew I was missing something critical but simple! I appreciate your help very much.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-12-14 : 02:05:18
Also in future you may be better off trying out in some MySQL forums if issue with MySQL specific syntax. This is MS SQL Server forum and we deal most;y with Transact SQL

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

sharonejackson
Starting Member

3 Posts

Posted - 2012-12-14 : 16:46:03
quote:
Originally posted by visakh16

Also in future you may be better off trying out in some MySQL forums if issue with MySQL specific syntax. This is MS SQL Server forum and we deal most;y with Transact SQL



My apologies, I thought I was in the right forum. I see now that I am not.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-12-15 : 12:19:36
No problems
Just reminded you

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -