SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to delete all comments
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sharonejackson
Starting Member

Canada
3 Posts

Posted - 12/10/2012 :  12:44:58  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/10/2012 :  12:51:15  Show Profile  Reply with Quote
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

Canada
3 Posts

Posted - 12/10/2012 :  13:06:25  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 12/14/2012 :  02:05:18  Show Profile  Reply with Quote
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

Canada
3 Posts

Posted - 12/14/2012 :  16:46:03  Show Profile  Reply with Quote
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

India
52317 Posts

Posted - 12/15/2012 :  12:19:36  Show Profile  Reply with Quote
No problems
Just reminded you

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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000