Jump to content

Recommended Posts

Hey guys I need help in deleting rows in mysql db. There're only 2 column in this table namely 'index' and 'link'

The column 'index' is numbered with ascending numbers from 1 onwards. What i wan is to delete the wh0le rows with index 50000 or less, which mean as long as it falls within 1 to 50,000 i want to delete it. any suggested query for this?

 

Thanks

 

It gives me an error  ???

 

SQL query:

 

DELETE FROM downloads WHERE INDEX <50000

 

MySQL said: Documentation

#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 'index < 50000' at line 1

Not sure, tried the same on my junk database and it worked perfectly fine.

 

I'm assuming that downloads is your table name right?  If that is indeed correct then the only thing that comes to my mind is the word INDEX maybe being a unique name.

 

Try adjusting syntax just for giggles.

 

DELETE FROM downloads WHERE index < 50000

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.