From: | "Mitch Vincent" <mitch(at)venux(dot)net> |
---|---|
To: | "John Draper" <crunch(at)webcrunchers(dot)com>, "Steve Heaven" <steve(at)thornet(dot)co(dot)uk> |
Cc: | <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Is it possible to search for sub-strings... |
Date: | 2000-09-19 16:00:07 |
Message-ID: | 007b01c02252$af01fe60$0200000a@doot |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
LIKE can use indexes, ~* can not, that's LIKE's main advantage (at least in
my opinion).
-Mitch
----- Original Message -----
From: "Steve Heaven" <steve(at)thornet(dot)co(dot)uk>
To: "John Draper" <crunch(at)webcrunchers(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Sent: Tuesday, September 19, 2000 3:44 AM
Subject: Re: [GENERAL] Is it possible to search for sub-strings...
> At 05:27 19/09/00 -0500, John McKown wrote:
> >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%';
>
> or
> select * from test1 where values ~ '^JYR';
>
> or for case insensitive:
> select * from test1 where values ~* '^JYR';
>
> Steve
>
>
> --
> thorNET - Internet Consultancy, Services & Training
> Phone: 01454 854413
> Fax: 01454 854412
> http://www.thornet.co.uk
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2000-09-19 16:03:40 | Re: Can't connect to 6.5.2 server with 7.0.2 client |
Previous Message | Ross J. Reedstrom | 2000-09-19 15:49:10 | Re: pgdump |