[EMAIL PROTECTED] wrote:
If I want to do "SELECT * FROM table WHERE field = value", how can I
do this matching text only and not case?

If you always need case insensitive comparison, the easiest way is to assign NOCASE collation to the field when creating the table:

create table mytable (field char collate NOCASE, ...)

If you need only this comparison to be case insensitive, you can do

SELECT * FROM table WHERE upper(field) = upper(value);

Reportedly, the latest CVS code for SQLite also supports

SELECT * FROM table WHERE field=value collate NOCASE;

This will probably make it into the next release.

Note that NOCASE collation in SQLite only recognizes letters A through Z as being equal to a through z. It doesn't support any other characters, e.g. accented Latin characters or characters from other scripts. If you need any kind of linguistically correct collation, you need to provide one yourself (luckily SQLite supports custom collations).

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to