SQL Delete Records within a specific Range [duplicate]
If you use Sql Server
delete from Table where id between 79 and 296
Note : the between
statement is inclusive, so rows 79
and 296
will also be deleted
After your edit : you now clarified that you want :
ID (>79 AND < 296)
So use this :
delete from Table where id > 79 and id < 296
You gave a condition ID (>79 and < 296) then the answer is:
delete from tab
where id > 79 and id < 296
this is the same as:
delete from tab
where id between 80 and 295
if id
is an integer.
All answered:
delete from tab
where id between 79 and 296
this is the same as:
delete from tab
where id => 79 and id <= 296
Mind the difference.