Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Re[2]: Reg. SQL Operator..

Re: Re[2]: Reg. SQL Operator..

From: Jared Still <jkstill_at_bcbso.com>
Date: Wed, 22 Nov 2000 18:11:16 -0800 (PST)
Message-Id: <10688.122780@fatcity.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US