Re: Comparing alphanumeric strings

From: Helena Whitaker <helena_at_creighton.edu>
Date: 1995/05/11
Message-ID: <Pine.HPP.3.91.950511142922.3853A-100000_at_finch.creighton.edu>#1/1


On 10 May 1995, Bani Limaye wrote:

>
> How does one do comparisons on character strings that are alphanumeric and
> get the right results?
> For example:
>
> select char_val from y
> where char_val > '711.00'
> and char_val < '911.00'
> order by char_val;
>
> returns (incorrectly):
>
> char_val
> ========
> 711.00A
> 714.00
> 74.00
> 900.00
>
>

	Maybe try ?
		select char_val from y
		where to_number(char_val) > 711.00
		  and to_number(char_val) < 911.00
		order by char_val;

	helena


--
<:>-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<:>
<: Helena Whitaker, Database Administrator      helena_at_creighton.edu :>
<: Creighton University               (0800-1630 CT)   (402)280-2311 :>
<: Old Gym - 2500 California Plaza                fax  (402)280-2573 :>
<: Admin Computing-Fin Sys Spt          Platform: HP-UX 9.0.4 (unix) :>
<: Omaha, NE 68178-0046              HP 9000/887 (aka H50), 842, 806 :>
<:                            Oracle 6.0.36.7.1/Banner Finance 2.0.3 :>
<:                            Oracle 7.1.3/DeLair Patient Accounting :>
<:>-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<->-<:>
Received on Thu May 11 1995 - 00:00:00 CEST

Original text of this message