Escaping underscores in LIKE

Поиск
Список
Период
Сортировка
От dev@archonet.com
Тема Escaping underscores in LIKE
Дата
Msg-id 20010308.9204000@client.archonet.com
обсуждение исходный текст
Ответы Re: Escaping underscores in LIKE  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Am I doing something stupid trying to escape an underscore in LIKE?
Version 7.1b3


richardh=> select * from foo;
  a
-----
 a_c
 a_d
 abc
(3 rows)

richardh=> select * from foo where a like 'a_c';
  a
-----
 a_c
 abc
(2 rows)

richardh=> select * from foo where a like 'a\_c';
  a
-----
 a_c
 abc
(2 rows)

richardh=> select * from foo where a like 'a\_c' escape '\\';
  a
-----
 a_c
 abc
(2 rows)

richardh=> select * from foo where a like 'ax_c' escape 'x';
  a
-----
 a_c
(1 row)

- Richard Huxton



В списке pgsql-general по дате отправления:

Предыдущее
От: dev@archonet.com
Дата:
Сообщение: CONTRIB: int8 sequence simulator
Следующее
От: "Trewern, Ben"
Дата:
Сообщение: RE: Data types?