Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: can wild cards be used in BETWEEN clause
On Mon, 12 Apr 2004 10:58:58 -0400, SAL <2_at_2.com> wrote:
> Hi,
> I am trying to select names of all countries from a column:
> SELECT country FROM countries_table
> WHERE
> country BETWEEN 'A%' AND 'Z%';
>
> This gives me every name except those starting with Z. I wonder if this
> is
> the right approach.
> Any help will be appreciated.
It seems to me perfectly logical. Show me everything between A and B should not show me B itself, because I've asked for things *between* two points, but not the points themselves.
Of course, AZERBAIJAN would get into my list, because it's bigger than A, and so is still between A and B.
If you want to see Zimbabwe and Zanzibar, then your 'between' markers need to be A at one end, and something like 'ZZ' at the other. ZZ% would permit anything up to ZY... to be displayed.
Regards
HJR
-- ------------------------------------------- Dizwell Informatics: http://www.dizwell.com -A mine of useful Oracle information- -Windows Laptop Rac- -Oracle Installations on Linux- ===========================================Received on Mon Apr 12 2004 - 17:18:38 CDT