By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,192 Members | 1,683 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,192 IT Pros & Developers. It's quick & easy.

string comparisons with case

P: n/a
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
Oct 4 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a

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

Oct 4 '06 #2

P: n/a

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
Oct 5 '06 #3

P: n/a
Ike

"davie" <da***********@yahoo.co.ukwrote in message
news:11**********************@m73g2000cwd.googlegr oups.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 ?
Oct 5 '06 #4

P: n/a
RTFM
http://dev.mysql.com/doc/refman/5.0/...nsitivity.html
Ike wrote:
"davie" <da***********@yahoo.co.ukwrote in message
news:11**********************@m73g2000cwd.googlegr oups.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 ?
Oct 5 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.