Re: [SQL] Searching Text Fields - Case Sensitive?
| От | Bart Ogryczak |
|---|---|
| Тема | Re: [SQL] Searching Text Fields - Case Sensitive? |
| Дата | |
| Msg-id | 37B3E046.278547CA@bart.w-wa.pl обсуждение исходный текст |
| Ответ на | Searching Text Fields - Case Sensitive? ("Mike Field" <mike@fieldco.com>) |
| Список | pgsql-sql |
Moray McConnachie wrote: > > > SELECT * FROM mydb WHERE description LIKE "%foobar%"; > > > it seems to be case sensitive. Is there a way to do it so it is NOT > > > case-sensitive? > > SELECT * FROM mydb WHERE lower(description) LIKE "%foobar%"; > > Brings up an interesting question. Which is faster, to use the lower/upper > functions as above [...] > or to use the pattern matching case-insensitive operator?LIKE seems to be much simpler then the regex pattern matching, so IMHO, the lower/upper & LIKE combination may be faster for short fields, but probably might be slower on very long text fields (when it has to convert whole thing to lower/upper case, before doing LIKE). Anyway, the differences are probably almost none either way. bart -- bart@bart.w-wa.pl || http://www.bart.w-wa.pl
В списке pgsql-sql по дате отправления: