string comparisons with case

string comparisons with case

am 04.10.2006 19:17:03 von Ike

If I have a field, `lastname`, and in the WHERE predicate of my SELECT
statement I want to test if it is LIKE 'Smith' without regards to case (i.e.
I want it to be true if it is smith or Smith or SMITH) how can I specify
this? Thanks, Ike

Re: string comparisons with case

am 04.10.2006 19:28:46 von zac.carey

Ike wrote:
> If I have a field, `lastname`, and in the WHERE predicate of my SELECT
> statement I want to test if it is LIKE 'Smith' without regards to case (i.e.
> I want it to be true if it is smith or Smith or SMITH) how can I specify
> this? Thanks, Ike

look at BINARY

Re: string comparisons with case

am 05.10.2006 03:12:44 von Davie

By default, MySQL searches are not case sensitive . This means that if
you search with col_name LIKE 's%', you get all column values that
start with S or s.

If you want a column always to be treated in case-sensitive fashion,
declare it with a case sensitive or binary collation.

Ike wrote:
> If I have a field, `lastname`, and in the WHERE predicate of my SELECT
> statement I want to test if it is LIKE 'Smith' without regards to case (i.e.
> I want it to be true if it is smith or Smith or SMITH) how can I specify
> this? Thanks, Ike

Re: string comparisons with case

am 05.10.2006 11:41:59 von Ike

"davie" wrote in message
news:1160010764.149933.319800@m73g2000cwd.googlegroups.com.. .
>
> By default, MySQL searches are not case sensitive . This means that if
> you search with col_name LIKE 's%', you get all column values that
> start with S or s.


But is that true with version >= 5.0 ?

Re: string comparisons with case

am 05.10.2006 17:00:19 von Davie

RTFM
http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html
Ike wrote:
> "davie" wrote in message
> news:1160010764.149933.319800@m73g2000cwd.googlegroups.com.. .
> >
> > By default, MySQL searches are not case sensitive . This means that if
> > you search with col_name LIKE 's%', you get all column values that
> > start with S or s.
>
>
> But is that true with version >= 5.0 ?