首先,作为字符串,2句是一样的。 其次,作为sql语句的话,如果字段c的类型是数字型,则也是正确的。
DELPHI的编译器会帮你优化成一样, 好了,所以一样,为什么还要问 2 和 2 不同???
数据库应用程序设计中,以下两条语句那个是正确的,为什么? sql:='select a,b ' + 'from taa ' + 'where c=1' sql:='select a,b from taa where c=1'
var tmpValue : string; begin tmpValue := '1'; sql := 'select a,b from taa where c= '+ tmpValue; ........................................... end;
2,498
社区成员
88,446
社区内容
加载中
试试用AI创作助手写篇文章吧