Re: SQL Where Like - Range it?!

From: Sterling <smullett(at)omeninc(dot)com>
To: Len Morgan <len-morgan(at)crcom(dot)net>
Subject: Re: SQL Where Like - Range it?!
Date: 2001-04-27 19:41:13
Message-ID: 3AE9CB59.3C429797@omeninc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

H-

Thank you to all that have replied.

Unfortunately none of the examples provided worked for me on my system.

I tried:
SELECT * from table where last_name BETWEEN 'A' AND 'G';
SELECT * from table where last_name >='A' AND last_name<'G';
SELECT * from table where last_name ~* '^[A-F]';

to no avail. 8^(

I didn't find a between function in the postgres documentation.

Is that some special function? I'm using PostgreSQL 6.5.3.

If anyone has any further thoughts please drop a line.
Thanks again and hopefully something will work out.
-Sterling

en Morgan wrote:
>
> >What I'd like to do is pull a list of records where there is a range of
> >last names; say from A - F.
> >select * from table where last_name LIKE 'A%' AND last_name LIKE 'F%' -
> >for example.
> >
> >The above code I've tried for this doesn't seem to work as I'd expect it
> >too?
>
> SELECT * FROM table WHERE last_name BETWEEN 'A' AND 'Fzzzzzzzzzzzzz' ;
> worked for me.
>
> You could also use BETWEEN 'A' AND 'G' to avoid all of the zzzzzzzzs at the
> end. Crude but effective.
>
> len morgan
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Steve Wolfe 2001-04-27 19:45:42 Re: FATAL 2 : after a vacuum, can't start postmaster anymore
Previous Message Michelle Murrain 2001-04-27 19:30:19 Another upgrade question