simple query question - Mailing list pgsql-general

From Dan Maher
Subject simple query question
Date
Msg-id XbcT7.72507$py4.34479716@news2.nash1.tn.home.com
Whole thread Raw
Responses Re: simple query question
List pgsql-general
Thanks in advance:

I want to do a particular type of pattern matching in a string, but am not a
regexp guru. Can ya help?

I want to find a row in a table that has a column that matches a string like

"jack nicholson - one flew over the cuckoo's nest"

but the columns I have are:

actor                   movie
------                 --------
jack nicholson     One flew over the cuckoo's nest

What I have been trying is

UPDATE blah WHERE actor LIKE
"jack nicholson - one flew over the cuckoo's nest"
OR movie LIKE
"jack nicholson - one flew over the cuckoo's nest"

of course that doesn't work. So the column in the table is a substring of
the search string. Parsing up the search string seems like the hard way to
do it, is there an easy way to see if a column's value is a subset of the
query string?

<sql idiot mode>
Also, if there is a DB-independent way to do this without a specific
PostgreSQL operator, that would be ideal.
</sql idiot mode>

Many thanks,
Dan





pgsql-general by date:

Previous
From: "Raymond C. Rodgers"
Date:
Subject: Re: 7.2 back to 7.1.3
Next
From: "Rob Hoffman"
Date:
Subject: Re: simple query question