MySQL查询返回包含空格的行 [英] MySQL Query to return rows that contain whitespace

查看:926
本文介绍了MySQL查询返回包含空格的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在MySQL数据库表上运行查询以返回列数据具有空格的所有行.例如:

I would like to run a query on a MySQL database table to return all the rows where the column data has white space. e.g.:

用户名
安迪·戴维斯
彼得
杰夫·史密斯
史蒂夫
鲍勃·保罗

Usernames
andy davies
peter
geoff smith
steve
bob paul

查询将仅返回安迪·戴维斯",杰夫·史密斯",鲍勃·保罗",而忽略彼得"和史蒂夫"

The query would only return 'andy davies', 'geoff smith', 'bob paul' and ignore 'peter' and 'steve'

有什么想法吗?

推荐答案

SELECT ...
   ...
  WHERE username LIKE '% %'

这篇关于MySQL查询返回包含空格的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆