Subject | BETWEEN Operator Inclusive? |
---|---|
Author | jackmills75 |
Post date | 2004-03-22T09:47:22Z |
Hi
How do I obtain all from a table where a varchar column "starts with"
a range of values.
I used the BETWEEN operator because I thought it was inclusive of the
values, reading various articles indicates that it is (although I
haven't seen a specific example for characters), but when I execute
this query
Select * from TABLE
Where NAME Between 'A' and 'D'
Only strings starting with 'A' to 'C' are returned.
NAME is VARCHAR(32).
Whereas this does return inclusive values
Select * from TABLE
Where TAG_NO BETWEEN 1 and 8
TAG_NO is Int.
Thanks for any help / explanation
Jack
How do I obtain all from a table where a varchar column "starts with"
a range of values.
I used the BETWEEN operator because I thought it was inclusive of the
values, reading various articles indicates that it is (although I
haven't seen a specific example for characters), but when I execute
this query
Select * from TABLE
Where NAME Between 'A' and 'D'
Only strings starting with 'A' to 'C' are returned.
NAME is VARCHAR(32).
Whereas this does return inclusive values
Select * from TABLE
Where TAG_NO BETWEEN 1 and 8
TAG_NO is Int.
Thanks for any help / explanation
Jack