Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Re[2]: Reg. SQL Operator..
On Tue, 21 Nov 2000, Ura! wrote:
>
> Ajay,
> ----------------------------------------
>
> AK> can also use
>
> AK> select ename from emp where upper(substr(ename,1,1)) between 'A' and 'S'
>
>
Well actually, no you can't.
Several replies in this thread have mad the same mistake.
This will find all entries beginning with 'A' through 'R', and any entries where ename = 'S'.
It will not find entries such as 'SMITH', 'SOUTH', 'SANDERS', etc.
Assume ENAME column is varchar2(15)
This query would find all rows that fit the criteria of all ENAMES that begin with A-S:
select ename
from emp
where upper(substr(ename,1,1)) between 'A' and 'SZZZZZZZZZZZZZZ';
Jared Still
Certified Oracle DBA and Part Time Perl Evangelist ;-)
Regence BlueCross BlueShield of Oregon
jkstill_at_bcbso.com - Work - preferred address
jkstill_at_teleport.com - private
Received on Wed Nov 22 2000 - 20:11:16 CST