string comparisons with case

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
Ike [ Mi, 04 Oktober 2006 19:17 ] [ ID #1488409 ]

Re: string comparisons with case

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
zac.carey [ Mi, 04 Oktober 2006 19:28 ] [ ID #1488410 ]

Re: string comparisons with case

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
Davie [ Do, 05 Oktober 2006 03:12 ] [ ID #1489797 ]

Re: string comparisons with case

"davie" <daviestrachan [at] yahoo.co.uk> wrote in message
news:1160010764.149933.319800 [at] 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 ?
Ike [ Do, 05 Oktober 2006 11:41 ] [ ID #1489799 ]

Re: string comparisons with case

RTFM
http://dev.mysql.com/doc/refman/5.0/en/case-sensitivity.html
Ike wrote:
> "davie" <daviestrachan [at] yahoo.co.uk> wrote in message
> news:1160010764.149933.319800 [at] 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 ?
Davie [ Do, 05 Oktober 2006 17:00 ] [ ID #1489801 ]
Datenbanken » mailing.database.mysql » string comparisons with case

Vorheriges Thema: trouble chanigng mysql 5 socket location
Nächstes Thema: IDE for stored procedures, are MySQL stored procedures reliable?