From: Tom Lane <tgl@sss.pgh.pa.us>
To: kaiq@realtyideas.com
Cc: Tom Techoueyres <tom@eurobase.net>
Cc: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] A search SQL query
Date: Thu, 02 Dec 1999 18:05:02 -0500
Message-ID: <29400.944175902@sss.pgh.pa.us> (raw)
In-Reply-To: <Pine.LNX.4.10.9912021645080.29007-100000@picasso.realtyideas.com>
<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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, kaiq@realtyideas.com, tom@eurobase.net
Subject: Re: [SQL] A search SQL query
In-Reply-To: <29400.944175902@sss.pgh.pa.us>
References: <Pine.LNX.4.10.9912021645080.29007-100000@picasso.realtyideas.com> <29400.944175902@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox