create table tb(A int)
insert tb select 1select * from tb where cast(A as varbinary)=cast(1 as varbinary)
/*
A
-----------
1
*/
(1 行受影响)select * from tb where cast(A as varbinary)=cast('1' as varbinary)
/*
A
-----------(0 行受影响)
*/
insert tb select 1select * from tb where cast(A as varbinary)=cast(1 as varbinary)
/*
A
-----------
1
*/
(1 行受影响)select * from tb where cast(A as varbinary)=cast('1' as varbinary)
/*
A
-----------(0 行受影响)
*/
--这样,肯定会报错。
select * from table where A='a'