Reputation: 4628
Is there a way in MYSQL to search for all the records with spaces and without spaces and also by flipping the strings
Example:
Search String: JM Edward
Expected Result:
J M Edward
JM Edward
J MEdward
Edward J M
Edward JM
Upvotes: 0
Views: 442
Reputation:
Would this work for what your search? It would return all of the results.
SELECT * FROM Names
WHERE Names LIKE '%J%' and Names LIKE '%M%' and Names LIKE '%Edward%'
Upvotes: 1
Reputation: 185
Yes there is, so your sql statement would look something similar to these
Select * from table like %J%
Which will show all results with the letter J in it and for space you would do it like so:
Select * from table % %
Add a space in between
Upvotes: 0