How to Make Case InSensitive???
How to Make Case InSensitive???
От:
"S.Ramaswamy" <srswamy@giasdl01.vsnl.net.in>
Дата:
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
Re: [SQL] How to Make Case InSensitive???
От:
David Hartwig <daveh@insightdist.com>
Дата:
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$'
Re: [SQL] How to Make Case InSensitive???
От:
Marcio Macedo <marciom@conectiva.com.br>
Дата:
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
Re: [SQL] How to Make Case InSensitive???
От:
David Hartwig <daveh@insightdist.com>
Дата:
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.