Re: Is it possible to search for sub-strings...

From: Andrew(dot)Mason(at)spektra(dot)co(dot)uk
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Is it possible to search for sub-strings...
Date: 2000-09-19 10:40:41
Message-ID: OF971E93D6.133EC0FA-ON8025695F.003A7438@spektra.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I find this useful where you have mixed case:

SELECT * FROM test1 WHERE values ~* 'JYR';

Andrew
----- Forwarded by Andrew Mason/Spektra on 19/09/00 11:38 -----

John McKown <joarmc(at)swbell(dot)net>
Sent by: pgsql-general-owner(at)hub(dot)org
19/09/00 11:27


To: John Draper <crunch(at)webcrunchers(dot)com>
cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Is it possible to search for sub-strings...

Assuming that the name of the table is "test1" and the variable containing
the values of interest is name "values", then:

SELECT * FROM test1 WHERE values LIKE 'JYR%';

On Tue, 19 Sep 2000, John Draper wrote:

> Ok, I have a question... lets say I have a key fields like this...
>
> JYR-34a
> JYR-34b
> JYR-34c
> JJG-67
> jUY-89
>
> I want to do a query on a substring, such that I can get all three
> of the JYR's to come up, regardless if it has an "a", "b", or "c"
> after it. Is that possible in SQL? If so, what would the query
> look like?
>
> John
>
>

Browse pgsql-general by date

  From Date Subject
Next Message Steve Heaven 2000-09-19 10:44:26 Re: Is it possible to search for sub-strings...
Previous Message postgres-interest 2000-09-19 10:34:38 Newbie Config Question