Re: [SQL] A search SQL query

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [SQL] A search SQL query
Дата
Msg-id 29400.944175902@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RE: [SQL] A search SQL query  (<kaiq@realtyideas.com>)
Список pgsql-sql
<kaiq@realtyideas.com> writes:
> seems we'll fall below the bottom line: even regular expression can not
> work here. Since "-" can be anywhere, no easy way out.

Sure you can do it with a regular expression ... it's ugly but you can
do it:

where partno ~ 'L-?M-?7-?4-?1-?C-?N-?S-?G-?S'

or possibly

where partno ~ 'L-*M-*7-*4-*1-*C-*N-*S-*G-*S'

if you need to allow multiple consecutive dashes.  '-?' means 0 or 1
dash, '-*' means 0 or more dashes...
        regards, tom lane


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

Предыдущее
От: Rini Dutta
Дата:
Сообщение: SQLState
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] How to avoid "Out of memory" using aggregate functions?