P Pipi. Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-11 #21 where (hm like '_') or (hm like '__') or (hm like '___') or (hm is null) or (hm='')
P pyk1 Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-11 #22 to Pipi. 您好,您的办法只能在QUERY的STRING属性中设置,可以通过,但我用 with query1 do begin close; sql.clear; sql.add('select * from test where (hm like '___')'); open; end; 却通不过!
to Pipi. 您好,您的办法只能在QUERY的STRING属性中设置,可以通过,但我用 with query1 do begin close; sql.clear; sql.add('select * from test where (hm like '___')'); open; end; 却通不过!
S structer Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-11 #23 最后语句写的有误吧,like后应该加单引号吧。 with query1 do begin close; sql.clear; sql.add('select * from test where (hm like ''___'')'); open; end;
最后语句写的有误吧,like后应该加单引号吧。 with query1 do begin close; sql.clear; sql.add('select * from test where (hm like ''___'')'); open; end;
K Kingron Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-11 #24 Pipi的方法虽然很笨,但是可以通过!起初我也这么想的。:)
P Pipi. Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-11 #25 sql.add('select * from test where (hm like ''___'')'); 注意在' '里面2个连续的单引号等于1个单引号
D ddev Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-11 #26 Select bh from table where hm like "___" “_”是单字符通配符,如果数据库不一样,根据你的数据库规定。
S sinpo Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-11 #27 关于字符串中单引号,可以这样解决 with query1 do begin close; sql.clear; sql.text:='select * from tablename where hm like 1'; params[0].asstring:='_'; open; end;
关于字符串中单引号,可以这样解决 with query1 do begin close; sql.clear; sql.text:='select * from tablename where hm like 1'; params[0].asstring:='_'; open; end;