Re: SQL Where Like - Range it?! - Mailing list pgsql-general

From Len Morgan
Subject Re: SQL Where Like - Range it?!
Date
Msg-id 007201c0cf29$ad97f640$0908a8c0@H233.bstx.cc
Whole thread Raw
In response to SQL Where Like - Range it?!  (Sterling <smullett@omeninc.com>)
Responses Re: SQL Where Like - Range it?!
List pgsql-general
>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


pgsql-general by date:

Previous
From: Jelle Ouwerkerk
Date:
Subject: rotating log files
Next
From: Peter Eisentraut
Date:
Subject: Re: rotating log files