Re: [GENERAL] SQL Regular expression
| От | John M. Flinchbaugh |
|---|---|
| Тема | Re: [GENERAL] SQL Regular expression |
| Дата | |
| Msg-id | Pine.LNX.4.10.9907142350520.7950-100000@butterfly.hjsoft.com обсуждение исходный текст |
| Ответ на | SQL Regular expression ("Albert Chen" <chen6178@hotmail.com>) |
| Список | pgsql-general |
On Wed, 14 Jul 1999, Albert Chen wrote:
> I want to search my database table named ex, whose the attribute is
> subject,
> and list the results that matches the keyword 'electric'.
> I run the SQL command: SELECT subject FROM ex WHERE subject='*electric*';
use one of the following:
select subject from ex where subject~'.*electric.*';
or
select subject from ex where subject like '%electric%';
the first uses postgresql's regular expressions, which are much like unix
regex. the second uses the sql standard like clause. this one will be
more portable to other dbms.
____________________}John Flinchbaugh{______________________
| -> glynis@hjsoft.com <- john@cs.millersv.edu |
| glynis@netrax.net http://www.hjsoft.com/~glynis/ |
~~Powered by Linux: Reboots are for hardware upgrades only~~
В списке pgsql-general по дате отправления: