A Question On "WHERE '3' BETWEEN '10' AND '35'" VERSES "WHERE 3 BETWEEN 10 AND 35"

From: aleatory <aleatory_at_hotmail.com>
Date: 9 Jan 2002 16:07:01 -0800
Message-ID: <a68a4ee0.0201091607.4d1842e_at_posting.google.com>



[Quoted] Hi all,

Another newbie question on SQL*Plus.

| SELECT *
| FROM dual
| WHERE 3 BETWEEN 10 AND 35
|
| no rows selected

I have no problem understanding the previous code. Since the number 3 isn't indeed between the numbers 10 and 35; therfore, no rows get selected.

| SELECT *
| FROM dual
| WHERE '3' BETWEEN '10' AND '35'
|
| D
| -
| X

[Quoted] I have no idea why SQL*Plus thinks the previous "WHERE" clause to be true. How does SQL*Plus evaluate the "WHERE" clause? If I were an SQL*Plus program, I would intuitively deduce, "Is the ASCII value '3' between the ASCII value '10' and another ASCII value of '35'? Then return no rows. Just looking at the result, however, my thinking is totally incorrect!
Would appreciate any helpful comment on this.

Thanks in advace.

alea Received on Thu Jan 10 2002 - 01:07:01 CET

Original text of this message