Home » SQL & PL/SQL » SQL & PL/SQL » How to search a string value irrespective of case sensitive
How to search a string value irrespective of case sensitive [message #234564] Wed, 02 May 2007 09:33 Go to next message
sreehari
Messages: 101
Registered: May 2006
Senior Member
Hi all

How can i search a string value irrespective of case sensitive.

eg:

Selct * from emp where ename = 'king' should get the records with ename 'KING', 'King', 'kInG'

Thanks
Re: How to search a string value irrespective of case sensitive [message #234566 is a reply to message #234564] Wed, 02 May 2007 09:36 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
>Selct * from emp where ename = 'king' should get the records with ename 'KING', 'King', 'kInG'
Not sure why this takes an expert to respond.
Select * from emp where upper(ename) = 'KING';

[Updated on: Wed, 02 May 2007 09:36] by Moderator

Report message to a moderator

Re: How to search a string value irrespective of case sensitive [message #234567 is a reply to message #234564] Wed, 02 May 2007 09:38 Go to previous messageGo to next message
compcoder
Messages: 30
Registered: April 2007
Location: Maryland USA
Member
Use either "Upper" or "Lower" on both sides of the where clause.
Re: How to search a string value irrespective of case sensitive [message #234708 is a reply to message #234564] Thu, 03 May 2007 00:26 Go to previous messageGo to next message
ShivrajGutte
Messages: 21
Registered: April 2007
Location: PUNE
Junior Member
Select * from emp where upper(ename) = upper('king')
Re: How to search a string value irrespective of case sensitive [message #234914 is a reply to message #234708] Thu, 03 May 2007 08:07 Go to previous message
joy_division
Messages: 4644
Registered: February 2005
Location: East Coast USA
Senior Member
ShivrajGutte wrote on Thu, 03 May 2007 01:26
Select * from emp where upper(ename) = upper('king')


I think the first two responses were sufficient.
Previous Topic: Query Help avg and count
Next Topic: substring problem
Goto Forum:
  


Current Time: Sun Dec 11 07:59:48 CST 2016

Total time taken to generate the page: 0.14629 seconds