Given:
- SQL Server
- Table called
TEST_TABLE
- Column in
TEST_TABLE
calledTEST_FIELD
of typeVARCHAR(50) NOT NULL
- Row 1: 10YR3/6
- Row 2: 10YR3/2
- Query:
SELECT TEST_FIELD FROM TEST_TABLE WHERE ...
Question:
In my where condition I need to test for values in the last character of the string. I notice the same behavior doing the following in the Where clause.
RIGHT(TEST_FIELD,1) > 3
CAST(RIGHT(TEST_FIELD,1) AS INT) > 3
Are they behaving the same through some inferred cast in case 1? Is case 1 deterministic?
Thanks in advance.
Matt