Re: [SQL] A search SQL query

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: kaiq(at)realtyideas(dot)com
Cc: Tom Techoueyres <tom(at)eurobase(dot)net>, pgsql-sql(at)postgreSQL(dot)org
Subject: Re: [SQL] A search SQL query
Date: 1999-12-02 23:05:02
Message-ID: 29400.944175902@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

<kaiq(at)realtyideas(dot)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

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 1999-12-02 23:32:59 Re: [SQL] How to avoid "Out of memory" using aggregate functions?
Previous Message kaiq 1999-12-02 22:53:43 RE: [SQL] A search SQL query