Prepare for your Next Interview
This is a discussion on match string using sql query... within the SQL forums, part of the Databases category; My application is to get a search string from the user and return the records from the database which matches the search string.. I am using LIKE operator in the ...
|
|||
|
match string using sql query...
My application is to get a search string from the user and return the records from the database which matches the search string..
I am using LIKE operator in the sql to get matching data.. But my problem is, the matching should be case insensitive.. For example, the data i required may be the Pen.. I have to get this value if i give any of the following possiblities as the search string.. p,pe,pen,PEN,Pen.. please help me with this.. ----------------------- suresh |
| Sponsored Links |
|
|||
|
Re: match string using sql query...
Hi,
U can try following query:- select pen_name from table_name where upper(pen_name) like '%PEN%'; or select pen_name from table_name where lower(pen_name) like '%pen%'; Reeta |
|
|||
|
Re: match string using sql query...
This will work
SELECT * FROM table_name WHERE Upper(column_name) LIKE Upper(search_string);
__________________
Lack of WILL POWER has caused more failure than lack of INTELLIGENCE or ABILITY. -sutnarcha- |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Difference between String.Convert Vs String.ToString | jbanx | C# | 6 | 03-24-2008 01:02 PM |
| String and StringBuffer | ramesh_etta | Java | 4 | 03-31-2007 09:25 AM |
| Getting exact recognition string | JobHelper | Rational Robot | 0 | 01-06-2007 01:32 AM |
| Microsoft CRM : Tailor activities to match your user's tasks | Jim.Anderson | Microsoft CRM | 0 | 09-27-2006 07:39 AM |
| String into Long | norman | C and C++ | 2 | 07-13-2006 10:51 PM |