Compare varchar2 [message #23467] |
Wed, 11 December 2002 11:14 |
Yelanda
Messages: 4 Registered: June 2002
|
Junior Member |
|
|
Hello,
Is there a function in SQL that converts VARCHAR2 to NUMBER (not to_number)? I need to compare 2 VARCHAR2 values, and find out which one is > or < than another.
Like compare PEN and PENCIL.
IF string1 > string2 THEN
.....
Thanks.
|
|
|
Re: Compare varchar2 [message #23469 is a reply to message #23467] |
Wed, 11 December 2002 11:23 |
Todd Barry
Messages: 4819 Registered: August 2001
|
Senior Member |
|
|
You can just compare the strings as in your example:
You can also use the greatest/least functions with strings.
Read up on the string comparision rules in the docs.
|
|
|