Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
正确的MySQL语法,用于删除列值在指定范围内的记录_Mysql - Fatal编程技术网

正确的MySQL语法,用于删除列值在指定范围内的记录

正确的MySQL语法,用于删除列值在指定范围内的记录,mysql,Mysql,我想删除MySQL表中的所有记录,其中“id”列中的值大于某个值,小于某个值 我试过这个: DELETE FROM `jos_users` WHERE `id` > 1303856 AND 'id' < 2557250 ; 删除'jos_users',其中'id`>1303856和'id'

我想删除MySQL表中的所有记录,其中“id”列中的值大于某个值,小于某个值

我试过这个:

 DELETE FROM `jos_users` WHERE `id` > 1303856 AND 'id' < 2557250 ;
删除'jos_users',其中'id`>1303856和'id'<2557250;
但是发生的是所有大于1303856的记录都被删除了..包括值为2557250和大于2557250的ID

那么在这种情况下,正确的mysql查询或语法是什么呢

提前感谢。

可以在

delete from `jos_users` where id between 1303856 and 2557250
这也应该起作用。注意
id
和'id'。“和”之间的差异

删除'jos_users',其中'id`>1303856和'id`<2557250;

和'id'将字符串'id'与数字2557250进行比较。“和”之间是有区别的。哦,哎呀……你说得对,我错了。所以基本上,如果我使用正确的“”,即使我的查询也可以工作?
DELETE FROM `jos_users` WHERE `id` > 1303856 AND `id` < 2557250 ;