Thread: How to Make Case InSensitive???
When I use SQL statements, how can I make it case insensitive. If I use SELECT * FROM series WHERE NAME='India' I want to select rows including those where NAME='INDIA' / NAME = 'india' and so on. Can someone help me in the above?? Regards S.Ramaswamy
S.Ramaswamy wrote: > When I use SQL statements, how can I make it case insensitive. If I > use > > SELECT * FROM series WHERE NAME='India' > > I want to select rows including those where NAME='INDIA' / NAME = > 'india' > and so on. > > Can someone help me in the above?? SELECT * FROM series WHERE upper(NAME) = 'INDIA' or SELECT * FROM series WHERE NAME ~* '^india$'
Hey... How does this " ~* " operator works ?!?!?! David Hartwig wrote: > > > SELECT * FROM series WHERE upper(NAME) = 'INDIA' > or > SELECT * FROM series WHERE NAME ~* '^india$' --Marcio Macedo Conectiva
Marcio Macedo wrote: > Hey... > > How does this " ~* " operator works ?!?!?! > > David Hartwig wrote: > > > > > > SELECT * FROM series WHERE upper(NAME) = 'INDIA' > > or > > SELECT * FROM series WHERE NAME ~* '^india$' > I don't use it myself, but it is a case insensitive regular expression match operator. "~' is the case sensitive operator. Do "\do" in psql to see all the operators.