List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:April 26 1999 8:28pm
Subject:Re: Selects with case sensitivity
View as plain text  
On Mon, Apr 26, 1999 at 02:15:03PM -0600, Sasha Pachev wrote:
> > Auth
> >   User  char(32)
> >   Pwd   char(16)
> > 
> >   Select * from Auth where User='barry' and strcmp(Pwd,'Sch')=0
> > 
> > It does what I want. Is this the best way?

No, it's likely to be quite a bit slower than the other solutions.

> There is an alternative way, I do not now if it is any
> better. Make your data type blob instead of char, and
> then = operator will be case-insensitive.


Instead of declaring it as a BLOB, just use the BINARY keyword
when you define the field.  Look at the CREATE TABLE docs for
more info on the BINARY attribute.  Obviously, you'll want Pwd to
be BINARY and User to be normal.

Looking for ISP that provides MySQLChristopher R. Jones26 Apr
  • Re: Looking for ISP that provides MySQLBill Gerrard26 Apr
  • Re: Looking for ISP that provides MySQLBill Rhodes26 Apr
    • Selects with case sensitivityBarry26 Apr
    • Re: Looking for ISP that provides MySQLChris Jester27 Apr
    • Re: Looking for ISP that provides MySQLKyle Cordes27 Apr
      • Re: Looking for ISP that provides MySQLJohn Elliott27 Apr
  • Re: Selects with case sensitivitySasha Pachev27 Apr
    • Re: Selects with case sensitivityThimble Smith27 Apr
      • Problems with BINARY keywordRichard Antecki28 Apr
        • Re: Problems with BINARY keywordFred Read28 Apr
        • Re: Problems with BINARY keywordVladimir Berezniker29 Apr
        • Problems with BINARY keywordMichael Widenius11 May
    • Re: Selects with case sensitivityMartin Ramsch27 Apr
      • Re: Selects with - ThanksBarry27 Apr