Re: Select statement question

From: Doug Silver <dsilver(at)quantified(dot)com>
To: ebp <ebp_register(at)yahoo(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Select statement question
Date: 2002-03-02 22:53:24
Message-ID: Pine.LNX.4.21.0203021450330.24487-100000@danzig.sd.quantified.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sat, 2 Mar 2002, ebp wrote:

> Im trying to select only the first names from a table that begin with an A.
> I tryed this:
> select fname,lname,subscriber_id from kbeg where fname='A*'||'a*'
> and no rows shows up, im positive that there are atleast 1,000 rows with fname starting with A.
> Any suggestions?
>
>

How about something like this

select fname,lname,subscriber_id from kbeg where fname~*'^a';

~ is for regular expression, * is case insensitive, and ^ means at the
beginning of fname.

Look at Chapter 4.10 in Bruce Momjian's "PostgreSQL" for more examples.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Doug Silver
Network Manager
Quantified Systems, Inc
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message daq 2002-03-02 23:13:53 Re: select statement...
Previous Message Dan Langille 2002-03-02 22:35:31 using LIMIT only on primary table