Home  >  Article  >  Backend Development  >  sql 数字查询 加引号 影响效率

sql 数字查询 加引号 影响效率

WBOY
WBOYOriginal
2016-06-20 12:44:401094browse

select * from [Table1] where [ID] = 10
select * from [Table1] where [ID] = '10'

这2种哪种效率更高,区别大吗


回复讨论(解决方案)

理论上是一样的
不过值被引号括起后,表示的是字符串
你的 sql server 是否支持字符串隐式的转换成数值?

几乎没有区别,一样快。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn