with adoquery1 do begin close; sql.clear; sql.add('select * from ussd_allout where phone =''13900121432'' or '); sql.add(' phone =''8613900121432'' and ListNo =057'); open; end;
'select * from ussd_allout where phone ='''13900121432''' or phone ='''8613900121432'''' 前后两个是界限符! 如果是字符串连接,那么,四个单引号为一个单引号 ''''+'abc'+''''一个带有单引号的字符串''ABC''
select * from ussd_allout where (phone ='13900121432' or phone ='8613900121432') and ListNo =057 看这样行不行!
begin
close;
sql.clear;
sql.add('select * from ussd_allout where phone =''13900121432'' or ');
sql.add(' phone =''8613900121432'' and ListNo =057');
open;
end;
前后两个是界限符!
如果是字符串连接,那么,四个单引号为一个单引号
''''+'abc'+''''一个带有单引号的字符串''ABC''
看这样行不行!
单引号可以括逐住双引号就这样吧