表a 的 字段id是int
select * from a where id='1'
和
select * from a where id=1
都是走索引 这1点跟oracle很不一样 , oracle有时候是不走索引 (当id是整形,而用户用 where id='1')难道mysql支持这样 select * from a where id='1'
和select * from a where id=1 是一样的效果
select * from a where id='1'
和
select * from a where id=1
都是走索引 这1点跟oracle很不一样 , oracle有时候是不走索引 (当id是整形,而用户用 where id='1')难道mysql支持这样 select * from a where id='1'
和select * from a where id=1 是一样的效果
select * from a where id='1'mySQL会把 '1' 转换为 1 (INT)