Querying for strings that match after prefix - Mailing list pgsql-general

From badlydrawnbhoy
Subject Querying for strings that match after prefix
Date
Msg-id 1149241642.145349.275530@j55g2000cwa.googlegroups.com
Whole thread Raw
Responses Re: Querying for strings that match after prefix
Re: Querying for strings that match after prefix
Re: Querying for strings that match after prefix
List pgsql-general
Hi all,

I hope this is the right forum for this, but please correct me if
somewhere else is more appropriate.

I need to locate all the entries in a table that match , but only after
a number of characters have been ignored. I have a table of email
addresses, and someone else has erroneously entered some addresses
prefixed with 'mailto:', which I'd like to ignore.

An example would be: john.smith@smiths.com should match
mailto:john.smith@smiths.com

I've tried the following

select address
from people
where address = (select replace(address, 'mailto:', '') from people);

which gives me the error

ERROR:  more than one row returned by a subquery used as an expression

I'm running on PostgreSQL 7.4.7

Thanks in advance,

BBB


pgsql-general by date:

Previous
From: "SunYanXiang"
Date:
Subject: How to extract data from files in pg_xlog
Next
From: "Thompson Ng Chun Yin"
Date:
Subject: Reinstalling Postgres 8.1 on Window problem