Edith Edith - 28 days ago 12
MySQL Question

WHERE column contains single word

How can I use SQL

like
to only display single words that are in a particular column of any row? For example, suppose I have the following rows in column1.

Column1

put return
need return
got return
bring return
server
client


The single-words output I would like is:

server
client


Can this be accomplish using
like
? I know this can be accomplished using regular expressions, but if possible, I would prefer using
LIKE
.

Answer

You can use not like:

where col not like '% %'