Ale Ale - 1 year ago 69
MySQL Question

How to delete rows with IDs in a specific range?

I tried looking for an answer to my question but I could not come up with anything to fit my case.

I'm simply looking for the correct sql statement to delete certain rows greater than a number but then I want it to stop at a certain point.

How can I do this?

DELETE FROM table_name where id >= 1043 and < 1101;

The above didn't work, it gave the error ...

1064 - You have an error in you SQL syntax;....for the right syntax to use near '< 1101' at line 1.

Answer Source
DELETE FROM table_name where id >= 1043 and id < 1101; 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download