0

hello,

See "ABC4_HUMAN" is a database value.i need to search this value using a character say"A" or by a word say"ABC".But i need to check this value only in "ABC4" part of the value "ABC4_HUMAN".

please provide me the query using "like" operator..
thanks

4
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Stefano Mtangoo
0

"SELECT Field_Name FROM Table_Name WHERE substr(Field_Name,1,4) LIKE 'A%'"

where;
Field_Name is the name of fields to return
Table_Name is the name of your table
substr(Field_Name,1,4) only evaluates the first four characters

0

Your example is too scarce to give a general solution.
Do all your entires look like "xxx_yyy"? Do you want to search only the part before the underscore? Then use the mysql substr() and locate() function to isolate that part and apply the like operator on it.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.