Skip site navigation (1) Skip section navigation (2)

SQL Where Like - Range it?!

From: Sterling <smullett(at)omeninc(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: SQL Where Like - Range it?!
Date: 2001-04-26 22:54:47
Message-ID: 3AE8A737.4C5D5A7C@omeninc.com (view raw or flat)
Thread:
Lists: pgsql-general
H-

I've found the docs on how to select a list of rows from a table were
all the records have a last name starting with 'W%'. 
select * from table where last_name LIKE 'W%'

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? 
I've even done 
select * from table where last_name LIKE 'A%' AND LIKE 'F%'

Can anyone provide some details or insights on how to accomplish this? 

Thanks. Much appreciated.
-Sterling

pgsql-general by date

Next:From: Clayton VernonDate: 2001-04-26 22:55:07
Subject: caching/ virtual file systems
Previous:From: Doug McNaughtDate: 2001-04-26 22:35:39
Subject: Re: JDBC speed question.

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group