Reputation: 23
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
.
Upvotes: 2
Views: 92
Reputation: 40481
SELECT * FROM YourTable
WHERE Column1 NOT LIKE '% %'
Or:
WHERE LOCATE(' ',Column1) = 0
Upvotes: 1