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

Recommended Answers

All 3 Replies

"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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.