Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
If I search for SFH630 it will show result like SFH 630, SFH-630 using MySQL


I have value in database SFH 630 SFH630 SFH-630 then how can I search all when I enter SFH6 please help using MySQL


Thank You,
Posted
Comments

If I understand your question correctly, you need to use LIKE operator, for example
SQL
Column LIKE '%SFH%630%'

Have a look at 3.3.4.7 Pattern Matching[^]
 
Share this answer
 
Comments
hareshdgr8 5-Sep-15 3:42am    
Sir cannot use this type because User Enter SFH6 this is not fixed word that we can split with SFH and Number 6 is different, User will enter SFH6 please Update me and Please help me I am stuck over here....
Wendelius 5-Sep-15 3:52am    
If you need to be able to find data based on parts of a string then you need to split the string first to separate parts and then use the parts in your condition.

You haven't specified the logic for splitting the string but for example if you need to separate numbers from characters, then build a small function which would return the number portion or the character portion and use those in the condition. Or if the string can be split based on the position you can use substring.

For example consider the following

Column LIKE CONCAT('%', SUBSTRING('SFH630', 1, 3), '%', SUBSTRING('SFH630', 4), '%')
hareshdgr8 5-Sep-15 4:41am    
Sir you already help me with previous question answer thank you so much


Mika Wendelius
[no name] 5-Sep-15 6:53am    
So than, why you don't give him a 5 and accept the answer? I let a 5 here :)
Wendelius 6-Sep-15 0:53am    
Thanks :)
Help by Mika Wendelius Great answer with help on time


Thank You
Thank You

Mika Wendelius
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900