Re: Wild Cards

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: Wild Cards
Дата
Msg-id 200101271016.f0RAGGF23603@linda.lfix.co.uk
обсуждение исходный текст
Ответ на Re: Wild Cards  (Adam Haberlach <adam@newsnipple.com>)
Список pgsql-general
Adam Haberlach wrote:
  >On Thu, Jan 25, 2001 at 08:40:23AM -0500, <No Name> wrote:
  >> I am not able to get Wildcards in PostgreSQL, I know its * (asterisk), but
  >> its not working. can someone show me a example or something?
  >
  >It's % and you have to use the LIKE operator.
  >
  >SELECT * FROM thistable WHERE name LIKE '%marley';

Alternatively use regular expressions as with grep:

   SELECT * FROM thistable WHERE name ~* 'scrooge$'

~  is regular expression match
~* is case-insensitive regular expression match

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Come now, and let us reason together, saith the LORD;
      though your sins be as scarlet, they shall be as white
      as snow; though they be red like crimson, they shall
      be as wool."                     Isaiah 1:18



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

Предыдущее
От: "Oliver Elphick"
Дата:
Сообщение: Re: get last sequence
Следующее
От: "carl garland"
Дата:
Сообщение: Re: Backends dying due to memory exhaustion--I'm stonkered