Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/65.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/4/regex/18.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/4/r/82.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_Regex_Sql Delete - Fatal编程技术网

删除带空格的记录-MySQL

删除带空格的记录-MySQL,mysql,regex,sql-delete,Mysql,Regex,Sql Delete,我有以下记录: +----+----------+ | id | word | +----+----------+ | 1 | abc123 | +----+----------+ | 2 | abc 123 | +----+----------+ | 3 | xyz12 3 | +----+----------+ | 4 | xyz123 | +----+----------+ | 5 | aaa 444 | +----+----------+ | 6 | a

我有以下记录:

+----+----------+
| id | word     |
+----+----------+
| 1  | abc123   |
+----+----------+
| 2  | abc 123  |
+----+----------+
| 3  | xyz12 3  |
+----+----------+
| 4  | xyz123   |
+----+----------+
| 5  |  aaa 444 |
+----+----------+
| 6  | aaa444   |
+----+----------+

Q如何删除带有空格的记录?这意味着记录2、3和5将被删除。

不需要正则表达式,只需在空格两侧进行全局匹配:

从表中删除类似“%”的单词


word是您定义的列,table是table word是的列。

您是否也担心第一个空格或最后一个空格字符?是的,开头、中间或结尾的任何空格都会触发删除。