Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Query to return rows that contain whitespace

Tags:

People also ask

Where is whitespace in MySQL?

MySQL SPACE() function MySQL SPACE() returns the string containing a number of spaces specified as an argument.

How do I return a row in MySQL?

To return only the first row that matches your SELECT query, you need to add the LIMIT clause to your SELECT statement. The LIMIT clause is used to control the number of rows returned by your query. When you add LIMIT 1 to the SELECT statement, then only one row will be returned.


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'

Any ideas?