Re: SELECT question

From: Medi Montaseri <medi(dot)montaseri(at)intransa(dot)com>
To: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
Cc: Brian Avis <brian(dot)avis(at)searhc(dot)org>, pgsql-general(at)postgresql(dot)org
Subject: Re: SELECT question
Date: 2003-01-31 19:56:32
Message-ID: 3E3AD4F0.1010400@intransa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

You can also use regular expression (which I am very happy to see PG has
adopted).

You can say

select whatever from whereever where something ~* 'brian';

The style is very similar to Perl's adoption of Regular Expression, its
called
Learn-Once-Use-Many.....

See page 77 of "PostgreSQL Developer's Handbook, SAMS" or your nearest
PG web page.

scott.marlowe wrote:

>On Thu, 30 Jan 2003, Brian Avis wrote:
>
>
>
>>Assuming the data in the text field will resemble any of the following.
>>
>>Brian K. Avis
>>Brian Avis
>>Brian
>>
>>Or whatever combo.
>>
>>
>>Brian Avis wrote:
>>
>>
>>
>>>I want to run a SELECT on a text field and match any of the following.
>>>
>>>brian
>>>Brian
>>>BRIAN
>>>
>>>Or any other combination. How do I tell SQL to ignore case when
>>>doing a SELECT?
>>>
>>>
>
>the other method, which I forgot to add to my previous post is to user
>lower()
>
>select * from table where lower(name) like '%bruce%';
>
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Kriger 2003-01-31 20:03:59 empty contrib diurectories?
Previous Message Doug McNaught 2003-01-31 19:35:48 Re: Clearing tables questions