I have SQL server 2008 R2, windows 7 OS.
Within the server, I have a table con1
which was created by following SQL statement.
CREATE TABLE [
I can't explain the behavior, but the following would get you what you want:
SELECT t1.digit FROM
(
select CAST(digit_str as int) as digit
from con1
where RIGHT(digit_str,1) <> '.'
AND digit_str <> '1'
) as t1
I'm not sure why the final where clause is causing that conversion to be executed since it looks to me like it should be already filtered out of the result set of t1.